Avoid forced copy in Array::logical_nulls
#5208
Labels
enhancement
Any new improvement worthy of a entry in the changelog
Array::logical_nulls
#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 asPrimitiveArray
andStringArray
. While the copy is perhaps not that bad (it is severalArc
s) I would like to avoid it entirely if possibleDescribe the solution you'd like
I would like to change
logical_nulls
to return aCow
to avoid the copy, as I propose in coralogix/arrow-datafusion#221Describe alternatives you've considered
We can not make any changes
Additional context
Thus came up in DataFusion PR apache/datafusion#8511
Logical nulls was added in #4691
The text was updated successfully, but these errors were encountered: