[ https://issues.apache.org/jira/browse/HIVE-26499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17603908#comment-17603908 ]
Zhizhen Hou commented on HIVE-26499: ------------------------------------ Master branch has solved this problem. https://issues.apache.org/jira/browse/HIVE-26408 > 启用向量化(hive.vectorized.execution.enabled=true)后,case when的计算结果出现预设外的值 > -------------------------------------------------------------------- > > Key: HIVE-26499 > URL: https://issues.apache.org/jira/browse/HIVE-26499 > Project: Hive > Issue Type: Bug > Components: Hive > Affects Versions: 3.1.0 > Environment: hdfs(3.1.1) > yarn(3.1.1) > zookeeper(3.4.6) > hive(3.1.0) > tez(0.9.1) > Reporter: Ricco-Chan > Priority: Major > Attachments: image-2022-08-29-11-04-21-921.png > > > -- case when预设值只有1、2、3,计算结果中出现5和6。发现此bug时,对应表使用的是parquet格式 + snappy 压缩 > > select distinct(traveller_type) from > ( > select pri_acct_no, > case > when (t1.consume_flag = '1' and substr(t1.areacode, 1, 2) <> > '65') then '2' > when (substr(t1.areacode, 1, 2) = substr(t1.country_id_new, 1, 2) > and t1.consume_flag = '1') then '1' > else '3' > end as traveller_type > from my_table t1 where consume_flag = '1' > ) t2; > ----------------------------------------------------------------- > !image-2022-08-29-11-04-21-921.png! -- This message was sent by Atlassian Jira (v8.20.10#820010)