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

Gopal V commented on HIVE-12315:
--------------------------------

[~mmccline]: the loop-hoist was correct, please review attached patch.

The divbyZero codepath unconditionally resets .noNulls=false, without 
considering that the .isNull[] state is not reset when the input had .noNulls = 
true.

> vectorization_short_regress.q has a wrong result issue for a double 
> calculation
> -------------------------------------------------------------------------------
>
>                 Key: HIVE-12315
>                 URL: https://issues.apache.org/jira/browse/HIVE-12315
>             Project: Hive
>          Issue Type: Bug
>          Components: Vectorization
>            Reporter: Matt McCline
>            Assignee: Gopal V
>            Priority: Critical
>         Attachments: HIVE-12315.1.patch, vectorization_short_regress_bug.q
>
>
> I suspect it is related to the fancy optimizations in vectorized double 
> divide that try to quickly process the batch without checking each row for 
> null.
> {code}
>  public static void setNullAndDivBy0DataEntriesDouble(
>       DoubleColumnVector v, boolean selectedInUse, int[] sel, int n, 
> DoubleColumnVector denoms) {
>     assert v.isRepeating || !denoms.isRepeating;
>     v.noNulls = false;
>     double[] vector = denoms.vector;
>     if (v.isRepeating && (v.isNull[0] = (v.isNull[0] || vector[0] == 0))) {
>       v.vector[0] = DoubleColumnVector.NULL_VALUE;
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to