You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Micah Kornfield (JIRA)" <ji...@apache.org> on 2019/06/19 05:22:00 UTC

[jira] [Resolved] (ARROW-5583) [Java] When the isSet of a NullableValueHolder is 0, the buffer field should not be used

     [ https://issues.apache.org/jira/browse/ARROW-5583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Micah Kornfield resolved ARROW-5583.
------------------------------------
       Resolution: Fixed
    Fix Version/s: 0.14.0

Issue resolved by pull request 4543
[https://github.com/apache/arrow/pull/4543]

> [Java] When the isSet of a NullableValueHolder is 0, the buffer field should not be used
> ----------------------------------------------------------------------------------------
>
>                 Key: ARROW-5583
>                 URL: https://issues.apache.org/jira/browse/ARROW-5583
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Java
>            Reporter: Liya Fan
>            Assignee: Liya Fan
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 0.14.0
>
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> For each variable-width vector, like the VarCharVector, it has a set method that uses a NullableValueHolder as the input parameter. When the isSet field is set to 0, it means the value  to set is null, so the buffer field of the NullableValueHolder is invalid, and should not be used. 
> For example, the user may set a null value in the VarCharVector with the following code snippet:
> NullableVarCharHolder holder = new NullableVarCharHolder();
> holder.isSet = 0;
> ...
> varCharVector.set(i, holder);
> Please note that in the code above, the holder.buffer is not set, so it is null. According to the VarCharVector#set method, it will set the bytes using holder.buffer even if holder.isSet equals 0. This will lead to an exception.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)