[
https://issues.apache.org/jira/browse/ARROW-1476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16251873#comment-16251873
]
ASF GitHub Bot commented on ARROW-1476:
---------------------------------------
siddharthteotia commented on a change in pull request #1316: ARROW-1476: [JAVA]
Implement Final ValueVector Updates
URL: https://github.com/apache/arrow/pull/1316#discussion_r150918390
##########
File path:
java/vector/src/main/java/org/apache/arrow/vector/BaseNullableVariableWidthVector.java
##########
@@ -615,8 +632,10 @@ public void transferTo(BaseNullableVariableWidthVector
target){
target.validityBuffer =
validityBuffer.transferOwnership(target.allocator).buffer;
target.valueBuffer =
valueBuffer.transferOwnership(target.allocator).buffer;
target.offsetBuffer =
offsetBuffer.transferOwnership(target.allocator).buffer;
- target.valueCount = valueCount;
- target.setLastSet(lastSet);
+ target.setLastSet(this.lastSet);
+ if (this.valueCount > 0) {
Review comment:
If we haven't done setValueCount() on the source vector before invoking
transfer(), then valueCount is essentially 0. Doing
target.setValueCount(this.valueCount) will corrupt the target vector if
this.valueCount is 0.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> [JAVA] Implement final ValueVector updates
> ------------------------------------------
>
> Key: ARROW-1476
> URL: https://issues.apache.org/jira/browse/ARROW-1476
> Project: Apache Arrow
> Issue Type: Sub-task
> Reporter: Jacques Nadeau
> Assignee: Siddharth Teotia
> Labels: pull-request-available
>
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)