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

   ### Rationale for this change
   
   `is_not_null` ignores a sliced array's offset, so its mask comes from the 
start of the parent array. For example, `is_not_null` on `[null, 1, null, 2]` 
sliced from offset 1 returns `[false, true, false]` instead of `[true, false, 
true]`. A filter using that mask can select null rows and drop non-null rows 
without an error.
   
   ### What changes are included in this PR?
   
   The output always starts at offset 0, so sharing the input validity buffer 
is correct only when the input offset is also 0. `isNotNullExec` still shares 
it in that case. Otherwise, it copies the bits from the input offset into a new 
bitmap. Inputs without a validity buffer still produce all true.
   
   ### Are these changes tested?
   
   I added `TestSlicedInput`, which checks `is_null` and `is_not_null` at 
offsets 0, 1, 8 and 9, with and without a validity buffer. On main, 
`is_not_null` fails at offsets 1, 8 and 9 with a validity buffer, and the other 
cases pass.
   
   On Linux amd64, `go test -count=1 ./arrow/compute/...`, `go vet`, `gofmt` 
and `golangci-lint` passed, along with the `prek` hooks on the changed files, 
including the Release Audit Tool.
   
   ### Are there any user-facing changes?
   
   Yes. `is_not_null` returns the correct mask on sliced arrays and slices of 
record batches, so filters select the right rows. There is no API change.
   
   Closes https://github.com/apache/arrow-go/issues/1453.
   


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