You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/12/14 15:31:09 UTC

[I] Avoid a copy in `Array::logical_nulls` [arrow-rs]

alamb opened a new issue, #5208:
URL: https://github.com/apache/arrow-rs/issues/5208

   **Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
   Some code requires "logical nullability" which is distinct from the "physical" nullability (what is defined by an Arrow arrays NullBuffer, if it has one)
   
   To this end, arrow includes `Array::logical_nulls` which will compute logical nulls.
   
   The issue is that it also potentially copies the `NullBuffer` for arrays that have it pre-computed, such as `PrimitiveArray` and `StringArray`. While the copy is perhaps not that bad (it is several `Arc`s) I would like to avoid it entirely if possible
   
   **Describe the solution you'd like**
   I would like to change `logical_nulls` to return a `Cow` to avoid the copy, as I propose in https://github.com/coralogix/arrow-datafusion/pull/221
   
   
   **Describe alternatives you've considered**
   We can not make any changes
   
   **Additional context**
   Thus came up in DataFusion PR https://github.com/apache/arrow-datafusion/pull/8511 
   
   Logical nulls was added in https://github.com/apache/arrow-rs/pull/4691 
   
   


-- 
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: github-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org