-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-44344: [Java] fix VectorSchemaRoot.getTransferPair for NullVector #44631
base: main
Are you sure you want to change the base?
Conversation
@Override | ||
public BufferAllocator getAllocator() { | ||
throw new UnsupportedOperationException("Tried to get allocator from NullVector"); | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't added a test to check this returns null
because this seems to me an implementation detail. Please let me know if you think otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assumed we are going to wait till nullability annotations are properly integrated.
I think I understand the value of requiring The ability to make zero-copy slices of ValueVector and VectorSchemaRoot is important to our usage of Arrow. Do you think it's possible to fix the bug and file an issue to forbid |
Right. I understand your point. We could create an issue for this and comment in the method. @lidavidm WDYT? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we update the base getAllocator
docstring to note that some subclasses may not have an allocator? Otherwise I didn't mean that we should block on nullability annotations, just that it would provide an additional layer of checks.
Fair enough. Thanks for clarifying @lidavidm |
8c4927b
to
8c1c1d8
Compare
…ector Signed-off-by: Maksim Yegorov <[email protected]> Code review comment: Add javadoc to getAllocator base method. mvn spotless:apply linter retrigger checks
Any idea of what's causing the
Seems like a flaky error? #43264 (comment) |
Hmm...I merged a gRPC upgrade earlier which had passed CI but maybe it's not quite safe yet. (I recall some newer version of gRPC or its dependencies started requiring newer glibc) |
Yup, reverting... #44645 |
Rationale for this change
Do not throw UnsupportedOperationException("Tried to get allocator from NullVector") from VectorSchemaRoot.slice() when slicing a VSR containing a NullVector or ZeroVector. Details in #44344
Are these changes tested?
Added unit test that would trigger an UnsupportedOperationException on the legacy path.