projjal commented on a change in pull request #6156:
URL: https://github.com/apache/arrow/pull/6156#discussion_r441440768
##########
File path:
java/vector/src/main/java/org/apache/arrow/vector/complex/ListVector.java
##########
@@ -662,15 +661,11 @@ public void reset() {
public ArrowBuf[] getBuffers(boolean clear) {
setReaderAndWriterIndex();
final ArrowBuf[] buffers;
- if (getBufferSize() == 0) {
- buffers = new ArrowBuf[0];
- } else {
- List<ArrowBuf> list = new ArrayList<>();
- list.add(offsetBuffer);
- list.add(validityBuffer);
- list.addAll(Arrays.asList(vector.getBuffers(false)));
- buffers = list.toArray(new ArrowBuf[list.size()]);
- }
+ List<ArrowBuf> list = new ArrayList<>();
+ list.add(validityBuffer);
+ list.add(offsetBuffer);
Review comment:
In this change, the order of validity and offset buffers is changed in
the getBuffers method for ListVector which creates problems with
serialization/deserialization resulting in test failures in Dremio. This would
break backward compatibility with existing serialised files.
Also keeping the existing order in #getBuffers will also break tests since
this PR replaces #getFieldBuffers with #getBuffers in VectorUnloader.
#getFieldBuffers and #getBuffers currently have different order of buffers
while #getFieldBuffers and #loadFieldBuffers same order, and the order should
be same for VectorLoader and VectorUnloader.
cc @pravindra @tianchen92
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]