-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-7494: [Java] Remove reader index and writer index from ArrowBuf #6133
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
Conversation
|
Test failed in Gandiva java test and I don't know how to run Gandiva java test locally, can someone help or give some guidance? thanks! @pravindra @praveenbingo |
| if (valueCount == 0) { | ||
| return valueBuffer.slice(0, 0); | ||
| } | ||
| return valueBuffer.slice(0, typeWidth == 0 ? |
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.
we should look at whether we're generating extra object in the case that the slice is the same as the original. In that case, we should probably just return the original rather than generate extra objects.
| List<ArrowBuf> result = new ArrayList<>(1); | ||
| setReaderAndWriterIndex(); | ||
| result.add(typeBuffer); | ||
| result.add(sliceTypeBuffer()); |
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.
calling getFieldBuffers should not create new arrow buf objects. If we're relying on reader/writer index on this we should stop.
| * Get the buffers belonging to this vector | ||
| * @return the inner buffers. | ||
| */ | ||
| public List<ArrowBuf> getFieldBuffers() { |
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.
As above. fieldbuffers should not be causing slices. The fact that we have reader/writer settings here is wrong and we should figure out why it was added. To clarify, getFieldBuffers() is distinct from getBuffers(). The former should be for getting access to underlying data for higher-performance algorithms. The latter is for sending the data over the wire. I think we've mixed up use of both. (Maybe you need to address that in a patch first?)
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.
Agreed, the main reason is that it uses getFieldBuffers in VectorUnloader which need writer/reader settings, and actually it should be replaced with getBuffers().
I opened a PR for this: #6156
|
Sorry I merged the int64 address space change, this will need to be rebased. |
It doesn't matter., I'll rebase this after this PR merged #6156. |
You need to build the C++ libraries for gandiva and add them to your linked library path (then you should be able to run java unit tests as normal.). |
|
Just checking @tianchen92 what is the status of this? |
It was blocked by #6156 |
d4608a9 to
356c300
Compare
|
Closing as stale. |
Related to ARROW-7494.
Reader and writer index and functionality doesn't belong on a chunk of memory and is due to inheritance from ByteBuf. As part of removing ByteBuf inheritance, we should also remove reader and writer indexes from ArrowBuf functionality. It wastes heap memory for rare utility. In general, a slice can be used instead of a reader/writer index pattern.