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

[jira] [Comment Edited] (HIVE-21742) Vectorization: CASE result type casting

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

Gopal V edited comment on HIVE-21742 at 6/4/19 11:18 PM:
---------------------------------------------------------

Did the latest patch just completely fail vectorization for the problem query?

{code}
+              expressions: q548284 (type: int), CAST( CASE WHEN ((q548284 = 4)) THEN (CAST( 0.8 AS decimal(2,1))) WHEN ((q548284 = 5)) THEN (CAST( 1 AS decimal(2,1))) ELSE (CAST( 8 AS decimal(2,1))) END AS decimal(11,1)) (type: decimal(11,1))
{code}

That is no longer vectorized?


was (Author: gopalv):
Did the latest patch just completely fail vectorization for the problem query?

> Vectorization: CASE result type casting
> ---------------------------------------
>
>                 Key: HIVE-21742
>                 URL: https://issues.apache.org/jira/browse/HIVE-21742
>             Project: Hive
>          Issue Type: Bug
>          Components: Logical Optimizer, Vectorization
>    Affects Versions: 3.1.1
>            Reporter: Gopal V
>            Assignee: Vineet Garg
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-21742.1.patch, HIVE-21742.2.patch, HIVE-21742.3.patch, HIVE-21742.4.patch, HIVE-21799.4.patch
>
>          Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> {code}
> create temporary table foo(q548284 int);
> insert into foo values(1),(2),(3),(4),(5),(6);
> select q548284, CASE WHEN ((q548284 = 1)) THEN (0.2) WHEN ((q548284 = 2)) THEN (0.4) WHEN ((q548284 = 3)) THEN (0.6) WHEN ((q548284 = 4)) THEN (0.8) WHEN ((q548284 = 5)) THEN (1) ELSE (null) END from foo order by q548284 limit 1;
> {code}
> Fails with 
> {code}
> Caused by: java.lang.ClassCastException: org.apache.hadoop.hive.ql.exec.vector.LongColumnVector cannot be cast to org.apache.hadoop.hive.ql.exec.vector.DecimalColumnVector
>         at org.apache.hadoop.hive.ql.exec.vector.DecimalColumnVector.setElement(DecimalColumnVector.java:130)
>         at org.apache.hadoop.hive.ql.exec.vector.expressions.IfExprColumnNull.evaluate(IfExprColumnNull.java:101)
> {code}
> This gets fixed if the case return of (1) is turned into a (1.0).



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