-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARROW-5583: [Java] When the isSet of a NullableValueHolder is 0, the …
…buffer field should not be used 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. Author: liyafan82 <[email protected]> Closes #4543 from liyafan82/fly_0613_varlen and squashes the following commits: d792e0a <liyafan82> Revise the code for setSafe methods 43a51c2 <liyafan82> Resolve comments 40c1548 <liyafan82> When the isSet of a NullableValueHolder is 0, the buffer field should not be used
- Loading branch information
1 parent
3fc0cc0
commit 2785a73
Showing
3 changed files
with
154 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters