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

   ### Rationale for this change
   
   `compute.TakeArray` and `compute.FilterArray` fail for 
`month_day_nano_interval` arrays:
   
   ```
   invalid: invalid values byte width for take
   type error: invalid values bit width
   ```
   
   The same happens for structs, lists and record batches with such a column, 
and for chunked arrays.
   
   The primitive take and filter kernels are registered with 
`exec.Primitive()`, which also matches the 128-bit `INTERVAL_MONTH_DAY_NANO` 
type, but `PrimitiveTake`, `ChunkedPrimitiveTake` and `PrimitiveFilter` only 
handle bit widths up to 64. The output buffers they allocate before returning 
the error are also leaked.
   
   ### What changes are included in this PR?
   
   - `month_day_nano_interval` gets the take and filter kernels built on 
`FSBImpl`, the ones `decimal128` already uses for its 16-byte values. They are 
registered ahead of the primitive kernels, since dispatch takes the first 
kernel that matches.
   - `ChunkedTakeSupported` returns false for this type, so chunked take 
concatenates the values like it does for decimals instead of asking for a 
chunked kernel that the `FSBImpl` kernel doesn't have.
   
   ### Are these changes tested?
   
   Yes, `TestSelectionMonthDayNanoInterval` covers take with null and out of 
bounds indices and sliced values, filter with both null selection behaviors, 
take with chunked values and indices, and take on a struct with a 
`month_day_nano_interval` field, all with a checked allocator. Without the fix 
all four subtests fail with the errors above.
   
   On Windows amd64 with Go 1.26.9, `go test -tags assert,test 
./arrow/compute/...` and `go test -short -tags assert,test,noasm 
./arrow/compute/...` pass, and `go vet` is clean for the changed packages.
   
   ### Are there any user-facing changes?
   
   Take and filter now work for `month_day_nano_interval` arrays, and for the 
nested types and tables that contain them. No API changes.
   
   This PR was prepared with AI assistance (Claude Code).
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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