ARROW-6117: [Java] Fix the set method of FixedSizeBinaryVector#4995
ARROW-6117: [Java] Fix the set method of FixedSizeBinaryVector#4995liyafan82 wants to merge 1 commit intoapache:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4995 +/- ##
==========================================
+ Coverage 87.56% 89.67% +2.1%
==========================================
Files 1003 668 -335
Lines 143269 98914 -44355
Branches 1418 0 -1418
==========================================
- Hits 125458 88702 -36756
+ Misses 17449 10212 -7237
+ Partials 362 0 -362
Continue to review full report at Codecov.
|
|
while this change seems reasonable to me, there are methods that will ignore null buffers if the intention is not to set them ( |
|
I checked the similar APIs in BaseVariableWidthVector.java and VarCharVector.java - the setXX functions do not treat null as a valid argument. So, this change will make the behavior inconsistent with other similar APIs. I'm assuming this was done to avoid the extra branch. @liyafan82, can you use the set(int index, int isSet, byte[] value) instead for your use-case ? |
8b5dd7a to
b8c7399
Compare
@pravindra Thanks a lot for your suggestion. So do you think we should add a parameter check here? This is slightly different from BaseVariableWidthVector#set: if a null is used there, this illegal argument will be detected by ArrowBuf#setBytes with an error message printed. Here, the illegal argument will not be noticed, until a NullPointerException is produced. This is trivial. So I am OK whether this check should be added or not. |
There was a problem hiding this comment.
good suggestion. thanks a lot.
b8c7399 to
b6e650c
Compare
|
thanks for fixing this, @liyafan82 |
For the set method, if the parameter is null, it should clear the validity bit. However, the current implementation throws a NullPointerException. Closes apache#4995 from liyafan82/fly_0802_fixset and squashes the following commits: b6e650c <liyafan82> Fix the set method of FixedSizeBinaryVector Authored-by: liyafan82 <fan_li_ya@foxmail.com> Signed-off-by: Pindikura Ravindra <ravindra@dremio.com>
For the set method, if the parameter is null, it should clear the validity bit. However, the current implementation throws a NullPointerException.