You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ZhangQiDong (Jira)" <ji...@apache.org> on 2021/05/18 13:22:00 UTC

[jira] [Updated] (HIVE-25135) Vectorization: Wrong Results issues in IF expressions about Two-level nested UDF

     [ https://issues.apache.org/jira/browse/HIVE-25135?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ZhangQiDong updated HIVE-25135:
-------------------------------
    Description: 
After set hive.vectorized.execution.enabled = true, if there are two levels nested UDF conversion fields in the IF expression, the result will be incorrect.

Test case:
create table if_orc (col string, col2 string) stored as orc;
insert into table if_orc values('1', 'abc'),('1', 'abc'),('2', 'def'),( '2', 'def');
set hive.vectorized.execution.enabled = true;
select if(col='2', col2, reverse(upper(col2))) from if_orc;

set hive.vectorized.execution.enabled = false;
Right Result:
+------+
| _c0  |
+------+
| CBA  |
| CBA  |
| def  |
| def  |
+------+

set hive.vectorized.execution.enabled = true;
Wrong result:
+------+
| _c0  |
+------+
| CBA  |
| CBA  |
| ABC  |
| ABC  |
+------+

  was:
After set hive.vectorized.execution.enabled = true, if there are two levels nested UDF conversion fields in the IF expression, the result will be incorrect.

Test case:
create table if_orc (col string, col2 string) stored as orc;
insert into table if_orc values('1', 'abc'),('1', 'abc'),('2', 'def'),( '2', 'def');
set hive.vectorized.execution.enabled = true;
select if(col='2', col2, reverse(upper(col2))) from if_orc;

Hivesql:
select if(col='2', col2, reverse(lupper (col2))) from if_orc;

set hive.vectorized.execution.enabled = false;
Right Result:
+------+
| _c0  |
+------+
| CBA  |
| CBA  |
| def  |
| def  |
+------+

set hive.vectorized.execution.enabled = true;
Wrong result:
+------+
| _c0  |
+------+
| CBA  |
| CBA  |
| ABC  |
| ABC  |
+------+


> Vectorization: Wrong Results issues in IF expressions about Two-level nested UDF
> --------------------------------------------------------------------------------
>
>                 Key: HIVE-25135
>                 URL: https://issues.apache.org/jira/browse/HIVE-25135
>             Project: Hive
>          Issue Type: Bug
>          Components: Vectorization
>    Affects Versions: 3.1.0, 4.0.0
>            Reporter: ZhangQiDong
>            Priority: Major
>
> After set hive.vectorized.execution.enabled = true, if there are two levels nested UDF conversion fields in the IF expression, the result will be incorrect.
> Test case:
> create table if_orc (col string, col2 string) stored as orc;
> insert into table if_orc values('1', 'abc'),('1', 'abc'),('2', 'def'),( '2', 'def');
> set hive.vectorized.execution.enabled = true;
> select if(col='2', col2, reverse(upper(col2))) from if_orc;
> set hive.vectorized.execution.enabled = false;
> Right Result:
> +------+
> | _c0  |
> +------+
> | CBA  |
> | CBA  |
> | def  |
> | def  |
> +------+
> set hive.vectorized.execution.enabled = true;
> Wrong result:
> +------+
> | _c0  |
> +------+
> | CBA  |
> | CBA  |
> | ABC  |
> | ABC  |
> +------+



--
This message was sent by Atlassian Jira
(v8.3.4#803005)