hcrosse opened a new pull request, #1586:
URL: https://github.com/apache/arrow-go/pull/1586

   ### Rationale for this change
   
   On array input, `ListElementRef` returned the whole list at row `Offset`. It 
now selects element `Offset` of each row, matching Arrow C++'s Substrait 
lowering to `list_element`:
   
   
https://github.com/apache/arrow/blob/976779b2aac587f51b87c3bd2e6ae4c36f75ab6c/cpp/src/arrow/engine/substrait/expression_internal.cc#L173-L191
   
   I reproduced this on v18.8.0 and main, with Go 1.26.10 on macOS arm64.
   
   ### What changes are included in this PR?
   
   `arrayStep` calls `compute.ListElement`. A null row gives null. Negative 
offsets or offsets past a row's length return errors, as in C++. This differs 
from Substrait's null results and indexing from the end. Negative offsets now 
return `ErrInvalid` instead of `ErrIndexRange`. Unsupported element types 
return `ErrNotImplemented` instead of the row's list. The scalar path is 
unchanged.
   
   ### Are these changes tested?
   
   `TestListElementRefPerRow` covers null rows, slices, large and fixed size 
lists, nested fields, a dot path on a record, and offset errors. All its cases 
fail on main and pass with this change. The `array list element` subtest of 
`TestNestedFieldRefResultOwnership` now expects elements.
   
   Full `go test -race ./arrow/...` and `golangci-lint` 2.13.2 passed on macOS 
arm64 with pinned test data.
   
   ### Are there any user-facing changes?
   
   Yes. Array list references select elements within each row instead of 
selecting a row's list. There is no API change.
   
   Closes https://github.com/apache/arrow-go/issues/1564.
   


-- 
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