You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Gopal V (JIRA)" <ji...@apache.org> on 2014/11/21 00:09:34 UTC
[jira] [Commented] (HIVE-8930) Vector coalesce operators should
push down casts
[ https://issues.apache.org/jira/browse/HIVE-8930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14220185#comment-14220185 ]
Gopal V commented on HIVE-8930:
-------------------------------
Running
{code}
SELECT
ROUND(sum(COALESCE(cast(call_duration as int), 0))/60, 2) as SwitchMOU
from xx
GROUP BY call_type;
{code}
produces the expected result, since the COALESCE() is between 2 integers now.
> Vector coalesce operators should push down casts
> ------------------------------------------------
>
> Key: HIVE-8930
> URL: https://issues.apache.org/jira/browse/HIVE-8930
> Project: Hive
> Issue Type: Bug
> Components: Vectorization
> Affects Versions: 0.14.0, 0.13.1
> Reporter: Gopal V
> Assignee: Jitendra Nath Pandey
>
> {code}
> set hive.vectorized.execution.enabled=true;
> create temporary table xx (call_duration string, call_type string) stored as orc;
> insert into table xx values (null, "X"), ("0", "X"), ("1", "X"), (null, "y");
> SELECT
> ROUND(sum(cast(COALESCE(call_duration, 0) as int))/60, 2) as SwitchMOU
> from xx
> GROUP BY call_type;
> {code}
> triggers the wrong cast, which results in a NULL, since the coalesce() has no resolved return type - it is either a STRING or an INT.
> {code}
> 0.02
> NULL
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)