From 2103b84f23d684a71d5364cc3753d4b357dda25c Mon Sep 17 00:00:00 2001 From: Noah Treuhaft Date: Thu, 15 Oct 2026 11:56:04 -0400 Subject: [PATCH] sio/jsonio: return empty record for empty projection The JSON reader returns records with all fields for an empty projection. Return empty records instead. --- sio/jsonio/reader.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sio/jsonio/reader.go b/sio/jsonio/reader.go index 2f1b9dcce..03327d599 100644 --- a/sio/jsonio/reader.go +++ b/sio/jsonio/reader.go @@ -23,7 +23,7 @@ type Reader struct { sctx *super.Context ctx context.Context stream *stream - projection field.List + projection field.Projection hasClosed atomic.Bool } @@ -32,15 +32,15 @@ func NewReader(ctx context.Context, sctx *super.Context, r io.Reader, p vio.Push if inputCap == 0 { inputCap = defaultInputCap } - var fields field.List + var proj field.Projection if p != nil { - fields = p.Projection().Paths() + proj = p.Projection() } return &Reader{ sctx: sctx, ctx: ctx, stream: newStream(ctx, r, concurrentReaders, inputCap), - projection: fields, + projection: proj, } } @@ -82,7 +82,7 @@ func preorderErr(idx uint32, start int, table *vector.BytesTable, err error) err func (r *Reader) newBuilder() jsonvec.Builder { if r.projection != nil { - return jsonvec.NewProjectionBuilder(r.projection) + return jsonvec.NewProjectionBuilder(r.projection.Paths()) } return jsonvec.NewBuilder() }