You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Stamatis Zampetakis (Jira)" <ji...@apache.org> on 2022/10/21 07:21:01 UTC
[jira] [Updated] (HIVE-26570) Incorrect results on sum(nvl(col,0)) when vectorization is ON
[ https://issues.apache.org/jira/browse/HIVE-26570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stamatis Zampetakis updated HIVE-26570:
---------------------------------------
Fix Version/s: (was: All Versions)
I cleared the fixVersion field since this ticket is still open. Please review this ticket and if the fix is already committed to a specific version please set the version accordingly and mark the ticket as RESOLVED.
According to the [JIRA guidelines|https://cwiki.apache.org/confluence/display/Hive/HowToContribute] the fixVersion should be set only when the issue is resolved/closed.
> 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
>
> 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
> --correct 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
> --incorrect 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
> --correct result
> a 12.12 12.12
> b 13.13 13.13
--
This message was sent by Atlassian Jira
(v8.20.10#820010)