[ https://issues.apache.org/jira/browse/HIVE-26570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
jhuchuan updated HIVE-26570: ---------------------------- Description: 1、 create table testdb.lc_appl ( loan_no string, fee_amt decimal(16,2) ) clustered by (loan_no) into 5 buckets stored as orc tblproperties('transactional'='true'); 2、 insert into testdb.lc_appl values ('a',12.12) insert into testdb.lc_appl values ('b',13.13) set hive.vectorized.execution.enabled=false; select loan_no ,sum(fee_amt),sum(nvl(fee_amt,0)) from testdb.lc_appl group by loan_no --right result a 12.12 12.12 b 13.13 13.13 set hive.vectorized.execution.enabled=true; select loan_no ,sum(fee_amt),sum(nvl(fee_amt,0)) from testdb.lc_appl group by loan_no --wrong result a 12.12 0 b 13.13 0 3、whether hive.vectorized.execution.enabled is true or false, the result below is always right select loan_no ,sum(fee_amt),sum(coalesce(fee_amt,0.00)) from testdb.lc_appl group by loan_no was: 1、 create table testdb.lc_appl ( loan_no string, fee_amt decimal(16,2) ) clustered by (loan_no) into 5 buckets stored as orc tblproperties('transactional'='true'); 2、 insert into testdb.lc_appl values ('a',12.12) insert into testdb.lc_appl values ('b',13.13) set hive.vectorized.execution.enabled=false; select loan_no ,sum(fee_amt),sum(nvl(fee_amt,0)) from testdb.lc_appl group by loan_no --right result a 12.12 12.12 b 13.13 13.13 set hive.vectorized.execution.enabled=true; select loan_no ,sum(fee_amt),sum(nvl(fee_amt,0)) from testdb.lc_appl group by loan_no --wrong result a 12.12 0 b 13.13 0 > Incorrect results on sum(nvl(col,0)) when vectorization is ON > ------------------------------------------------------------- > > Key: HIVE-26570 > URL: https://issues.apache.org/jira/browse/HIVE-26570 > Project: Hive > Issue Type: Bug > Components: Vectorization > Affects Versions: 2.1.1 > Reporter: jhuchuan > Priority: Major > Fix For: All Versions > > > 1、 > create table testdb.lc_appl > ( > loan_no string, > fee_amt decimal(16,2) > ) > clustered by (loan_no) > into 5 buckets > stored as orc > tblproperties('transactional'='true'); > > 2、 > insert into testdb.lc_appl > values ('a',12.12) > insert into testdb.lc_appl > values ('b',13.13) > > set hive.vectorized.execution.enabled=false; > select loan_no ,sum(fee_amt),sum(nvl(fee_amt,0)) > from testdb.lc_appl > group by loan_no > --right result > a 12.12 12.12 > b 13.13 13.13 > > > set hive.vectorized.execution.enabled=true; > select loan_no ,sum(fee_amt),sum(nvl(fee_amt,0)) > from testdb.lc_appl > group by loan_no > --wrong result > a 12.12 0 > b 13.13 0 > > 3、whether hive.vectorized.execution.enabled is true or false, the result > below is always right > select loan_no ,sum(fee_amt),sum(coalesce(fee_amt,0.00)) > from testdb.lc_appl > group by loan_no > -- This message was sent by Atlassian Jira (v8.20.10#820010)