You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "maksimyego-db (via GitHub)" <gi...@apache.org> on 2024/10/09 02:55:01 UTC

[I] [Java] VectorSchemaRoot.slice() throws for NullVector [arrow]

maksimyego-db opened a new issue, #44344:
URL: https://github.com/apache/arrow/issues/44344

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   When [slicing a VectorSchemaRoot](https://github.com/apache/arrow/blob/release-17.0.0-rc2/java/vector/src/main/java/org/apache/arrow/vector/VectorSchemaRoot.java#L341) wrapping a NullVector, [NullVector.getAllocator()](https://github.com/apache/arrow/blob/release-17.0.0-rc2/java/vector/src/main/java/org/apache/arrow/vector/NullVector.java#L160) will throw `UnsupportedOperationException("Tried to get allocator from NullVector")`
   
   Tangentially related to https://github.com/apache/arrow/issues/30866 that was fixed in https://github.com/apache/arrow/pull/41066 for some vector types.
   
   ### Component(s)
   
   Java


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

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


Re: [I] [Java] VectorSchemaRoot.slice() throws for NullVector [arrow]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm closed issue #44344: [Java] VectorSchemaRoot.slice() throws for NullVector
URL: https://github.com/apache/arrow/issues/44344


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

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


Re: [I] [Java] VectorSchemaRoot.slice() throws for NullVector [arrow]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #44344:
URL: https://github.com/apache/arrow/issues/44344#issuecomment-2404107616

   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.


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

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


Re: [I] [Java] VectorSchemaRoot.slice() throws for NullVector [arrow]

Posted by "myegorov (via GitHub)" <gi...@apache.org>.
myegorov commented on issue #44344:
URL: https://github.com/apache/arrow/issues/44344#issuecomment-2453748005

   take


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

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


Re: [I] [Java] VectorSchemaRoot.slice() throws for NullVector [arrow]

Posted by "maksimyego-db (via GitHub)" <gi...@apache.org>.
maksimyego-db commented on issue #44344:
URL: https://github.com/apache/arrow/issues/44344#issuecomment-2405505041

   take


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

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


Re: [I] [Java] VectorSchemaRoot.slice() throws for NullVector [arrow]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #44344:
URL: https://github.com/apache/arrow/issues/44344#issuecomment-2458443632

   Issue resolved by pull request 44631
   https://github.com/apache/arrow/pull/44631


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

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


Re: [I] [Java] VectorSchemaRoot.slice() throws for NullVector [arrow]

Posted by "maksimyego-db (via GitHub)" <gi...@apache.org>.
maksimyego-db commented on issue #44344:
URL: https://github.com/apache/arrow/issues/44344#issuecomment-2402805513

   Not to lose sight of the original issue: We [should be able to slice](https://arrow.apache.org/docs/java/vector_schema_root.html#vectorschemaroot) a VectorSchemaRoot containing `NullVector`s, 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.
   
   Another alternative is to case match on NullVector in https://github.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 workaround where conceivably any public ValueVector APIs that require the allocator parameter should work on NullVectors.


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

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


Re: [I] [Java] VectorSchemaRoot.slice() throws for NullVector [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on issue #44344:
URL: https://github.com/apache/arrow/issues/44344#issuecomment-2401316724

   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 


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

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