You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Zhihua Deng (Jira)" <ji...@apache.org> on 2020/04/22 15:30:00 UTC

[jira] [Updated] (HIVE-23269) Unsafe comparing bigints and chars

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

Zhihua Deng updated HIVE-23269:
-------------------------------
    Summary: Unsafe comparing bigints and chars  (was: Unsafe compares bigints and chars)

> Unsafe comparing bigints and chars
> ----------------------------------
>
>                 Key: HIVE-23269
>                 URL: https://issues.apache.org/jira/browse/HIVE-23269
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Zhihua Deng
>            Priority: Major
>         Attachments: HIVE-23269.patch
>
>
> Comparing bigints and varchars or chars may result to wrong result,  for example:
> CREATE TABLE test_a (appid1 varchar(256),  appid2 char(20));
> INSERT INTO  test_a VALUES ('2882303761517473127', '2882303761517473127'), ('2882303761517473276','2882303761517473276');
> SET hive.strict.checks.type.safety=false;
> SELECT appid1 FROM test_a WHERE appid1 = 2882303761517473127;
> SELECT appid2 FROM test_a WHERE appid2 = 2882303761517473127;​
> Both queries will output the row: ('2882303761517473276','2882303761517473276')



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