jhorstmann opened a new pull request #1499:
URL: https://github.com/apache/arrow-rs/pull/1499


   # Which issue does this PR close?
   
   <!---
   We generally require a GitHub issue to be filed for all bug fixes and 
enhancements and this helps us generate change logs for our releases. You can 
link an issue to this PR using the GitHub syntax. For example `Closes #123` 
indicates that this PR will close issue #123.
   -->
   
   Closes #510.
   
   # Rationale for this change
   
   This is an alternative implementation to #521 of the `nullif` kernel that 
works by slicing the buffers of the array depending on the data type. For most 
data types this can be done without copying data. The exceptions are boolean 
arrays (when the offset is not a multiple of 8) and list arrays because there 
are some assumptions that offsets start at zero.
   
   There are several TODO still left in the code to verify the correct slicing 
logic for some data types. It also seems a bit strange that this slicing logic 
is only needed for a single kernel and I also don't like that we still need to 
copy for some data types.
   
   A better design would require some larger refactorings of the current data 
model:
   
   - Remove the `offset` from `ArrayData` so that all slicing has to be pushed 
down into buffers
   - Add a `offset` field to `Bitmap` so that bitmaps can be sliced without 
copying
   - Also use the `Bitmap` as the data holder for boolean arrays
   
   # What changes are included in this PR?
   
   I added the kernel as a separate function to make the diff easier to read, 
if we decide to merge this it should replace the existing `nullif` kernel.
   
   The api changes since the `nullif` kernel now takes an `ArrayRef` instead of 
a `PrimitiveArray`.
   


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