[ 
https://issues.apache.org/jira/browse/HIVE-18629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16354350#comment-16354350
 ] 

Sergey Shelukhin commented on HIVE-18629:
-----------------------------------------

[~vihangk1] no that makes sense, they might be related. I don't see that the 
patch there handles copySelected though.
Note that If... expr class has two paths; if the condition vector (#1) is 
repeating it calls copySelected on v2 or v3 (the sides of the case expression); 
otherwise it goes one by one to look at v1 values to copy values from v2 and v3 
one by one.
This separation by v1's repeatability should have no bearing on how v2 and v3 
are treated; however the separate-setVal logic in ifexpr, under copySelected 
path, has isNull checks protecting setVal, whereas copySelected doesn't have 
such checks and calls setVal blindly. So as far as I can tell either this patch 
is necessary, or null checks on the non-repeating path in IfExpr... are 
unnecessary.
That's just the low level observation I made, I'm not super familiar with 
vectorization changes recently.

So this may be necessary in addition to HIVE-18622.





> copyValues in BytesColumnVector may be missing null checks
> ----------------------------------------------------------
>
>                 Key: HIVE-18629
>                 URL: https://issues.apache.org/jira/browse/HIVE-18629
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Sergey Shelukhin
>            Assignee: Sergey Shelukhin
>            Priority: Major
>         Attachments: HIVE-18629.patch
>
>
> {noformat}
> Caused by: java.lang.NullPointerException
>       at java.lang.System.arraycopy(Native Method)
>       at 
> org.apache.hadoop.hive.ql.exec.vector.BytesColumnVector.setVal(BytesColumnVector.java:173)
>       at 
> org.apache.hadoop.hive.ql.exec.vector.BytesColumnVector.copySelected(BytesColumnVector.java:333)
>       at 
> org.apache.hadoop.hive.ql.exec.vector.expressions..evaluate(IfExprStringGroupColumnStringGroupColumn.java:83)
>       at 
> org.apache.hadoop.hive.ql.exec.vector.VectorSelectOperator.process(VectorSelectOperator.java:133)
> {noformat}
> IfExprStringGroupColumnStringGroupColumn code below the v1.isRepeating case 
> has isNull checks for v2/v3 buffers that copySelected is missing. 



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

Reply via email to