zeroshade opened a new issue, #1471:
URL: https://github.com/apache/arrow-go/issues/1471

   ### Describe the bug
   
   `GetReferencedValue` resolves a `StructFieldRef` on an array with 
`v.Value.Children()[r.Field]`. That uses the child data as stored, without 
applying the parent struct array's offset and length. When the struct column 
comes from a sliced record batch or array, a nested field reference returns the 
wrong length and the wrong values.
   
   ### To reproduce
   
   Schema `s: struct<a: int32>` with rows `[{"s": {"a": 1}}, {"s": null}, {"s": 
{"a": 3}}, {"s": {"a": 4}}]`. Evaluate the field reference `s.a` with 
`exprs.ExecuteScalarExpression`:
   
   - On the full record: `[1 null 3 4]` (correct).
   - On `rec.NewSlice(2, 4)`: `[1 null 3 4]`. Expected `[3 4]`.
   
   ### Expected behavior
   
   The referenced child should be sliced to the parent's offset and length, as 
`array.Struct.Field` does (`NewSliceData(child, offset, offset+len)`).
   
   ### Component(s)
   
   Go, Compute (`arrow/compute/exprs`)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to