hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aihua Xu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-13235) Insert from select generates incorrect result when hive.optimize.constant.propagation is on
Date Mon, 02 May 2016 20:18:13 GMT

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

Aihua Xu commented on HIVE-13235:
---------------------------------

Attached patch-4: for non-cbo case, we will keep track of the select column's original expression
and use that rather than using the alias to match against another column info. We will not
do that for cbo case since cbo has optimized AST tree and may not have the original expression.


> Insert from select generates incorrect result when hive.optimize.constant.propagation
is on
> -------------------------------------------------------------------------------------------
>
>                 Key: HIVE-13235
>                 URL: https://issues.apache.org/jira/browse/HIVE-13235
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Planning
>    Affects Versions: 2.0.0
>            Reporter: Aihua Xu
>            Assignee: Aihua Xu
>         Attachments: HIVE-13235.1.patch, HIVE-13235.2.patch, HIVE-13235.3.patch, HIVE-13235.4.patch
>
>
> The following query returns incorrect result when constant optimization is turned on.
The subquery happens to have an alias p1 to be the same as the input partition name. Constant
optimizer will optimize it incorrectly as the constant.
> When constant optimizer is turned off, we will get the correct result.
> {noformat}
> set hive.cbo.enable=false;
> set hive.optimize.constant.propagation = true;
> create table t1(c1 string, c2 double) partitioned by (p1 string, p2 string);
> create table t2(p1 double, c2 string);
> insert into table t1 partition(p1='40', p2='p2') values('c1', 0.0);
> INSERT OVERWRITE TABLE t2  select if((c2 = 0.0), c2, '0') as p1, 2 as p2 from t1 where
c1 = 'c1' and p1 = '40';
> select * from t2;
> 40   2
> {noformat}



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

Mime
View raw message