-
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
ARROW-4539: [Java] Fix child vector count for lists. #3625
Conversation
praveenbingo
commented
Feb 12, 2019
- Child vector count was not set correctly for lists. Fixed to use the right count.
- Child vector count was not set correctly for lists. Fixed to use the right count.
@siddharthteotia - could you please review.. |
@@ -0,0 +1,65 @@ | |||
package org.apache.arrow.vector; |
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.
This files needs an Apache license header.
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.
@xhochy yup missed it..added them now.
Codecov Report
@@ Coverage Diff @@
## master #3625 +/- ##
=========================================
+ Coverage 87.76% 89% +1.23%
=========================================
Files 673 447 -226
Lines 82839 53792 -29047
Branches 1069 0 -1069
=========================================
- Hits 72704 47877 -24827
+ Misses 10020 5915 -4105
+ Partials 115 0 -115
Continue to review full report at Codecov.
|
@@ -744,7 +744,7 @@ public void setValueCount(int valueCount) { | |||
} | |||
/* valueCount for the data vector is the current end offset */ | |||
final int childValueCount = (valueCount == 0) ? 0 : | |||
offsetBuffer.getInt(valueCount * OFFSET_WIDTH); | |||
offsetBuffer.getInt(lastSet * OFFSET_WIDTH); |
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.
So were we always setting the value count for child vector incorrectly? I am not clear what the problem is. Is there a special case we have run into?
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.
Hi! I ran into this over on #3294, when I tried to convert a string array from a JDBC field into a VarChar ListVector. If one of the values in the JDBC string array was null
, I couldn't read the value after it from the VarChar ListVector (the following value came back as an empty string).
@praveenbingo was kind enough to put together this PR to fix the issue.
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.
Yup, @siddharthteotia - we were not correctly handling lists that could have null values (setting child vector count using valuecount will not handle cases where valuecount < lastSet i.e. presence of nulls).
It does not affect List of FixedWidthVectors and only VariableWidthVectors.
Please let me know if you would need more information.
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.
Thanks @mikepigott and @praveenbingo
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.
+1
* ARROW-4539: [Java] Fix child vector count for lists. - Child vector count was not set correctly for lists. Fixed to use the right count. * ARROW-4539: [Java] Add license header.