[ https://issues.apache.org/jira/browse/HIVE-12384?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Damien Carol updated HIVE-12384: -------------------------------- Description: Union queries may produce incorrect result on TEZ. TEZ removes union op, thus might loose the implicit cast in union op. Reproduction test case: {code:sql} set hive.cbo.enable=false; set hive.execution.engine=tez; select (x/sum(x) over()) as y from(select cast(1 as decimal(10,0)) as x from (select * from src limit 2)s1 union all select cast(1 as decimal(10,0)) x from (select * from src limit 2) s2 union all select '100000000' x from (select * from src limit 2) s3)u order by y; select (x/sum(x) over()) as y from(select cast(1 as decimal(10,0)) as x from (select * from src limit 2)s1 union all select cast(1 as decimal(10,0)) x from (select * from src limit 2) s2 union all select cast (null as string) x from (select * from src limit 2) s3)u order by y; {code} was: Union queries may produce incorrect result on TEZ. TEZ removes union op, thus might loose the implicit cast in union op. Reproduction test case: set hive.cbo.enable=false; set hive.execution.engine=tez; select (x/sum(x) over()) as y from(select cast(1 as decimal(10,0)) as x from (select * from src limit 2)s1 union all select cast(1 as decimal(10,0)) x from (select * from src limit 2) s2 union all select '100000000' x from (select * from src limit 2) s3)u order by y; select (x/sum(x) over()) as y from(select cast(1 as decimal(10,0)) as x from (select * from src limit 2)s1 union all select cast(1 as decimal(10,0)) x from (select * from src limit 2) s2 union all select cast (null as string) x from (select * from src limit 2) s3)u order by y; > Union Operator may produce incorrect result on TEZ > -------------------------------------------------- > > Key: HIVE-12384 > URL: https://issues.apache.org/jira/browse/HIVE-12384 > Project: Hive > Issue Type: Bug > Components: Hive > Affects Versions: 0.14.0, 1.0.0, 1.1.0, 1.0.1, 1.2.1 > Reporter: Laljo John Pullokkaran > Assignee: Laljo John Pullokkaran > Fix For: 2.0.0 > > Attachments: HIVE-12384.1.patch, HIVE-12384.2.patch, > HIVE-12384.3.patch, HIVE-12384.4.patch > > > Union queries may produce incorrect result on TEZ. > TEZ removes union op, thus might loose the implicit cast in union op. > Reproduction test case: > {code:sql} > set hive.cbo.enable=false; > set hive.execution.engine=tez; > select (x/sum(x) over()) as y from(select cast(1 as decimal(10,0)) as x > from (select * from src limit 2)s1 union all select cast(1 as decimal(10,0)) > x from (select * from src limit 2) s2 union all select '100000000' x from > (select * from src limit 2) s3)u order by y; > select (x/sum(x) over()) as y from(select cast(1 as decimal(10,0)) as x from > (select * from src limit 2)s1 union all select cast(1 as decimal(10,0)) x > from (select * from src limit 2) s2 union all select cast (null as string) x > from (select * from src limit 2) s3)u order by y; > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)