[
https://issues.apache.org/jira/browse/HIVE-23269?focusedWorklogId=426583&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-426583
]
ASF GitHub Bot logged work on HIVE-23269:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 23/Apr/20 15:56
Start Date: 23/Apr/20 15:56
Worklog Time Spent: 10m
Work Description: dengzhhu653 commented on a change in pull request #992:
URL: https://github.com/apache/hive/pull/992#discussion_r413918717
##########
File path: ql/src/test/results/clientpositive/llap/unsafe_compare.q.out
##########
@@ -0,0 +1,40 @@
+PREHOOK: query: CREATE TABLE test_a (appid1 varchar(256), appid2 char(20))
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@test_a
+POSTHOOK: query: CREATE TABLE test_a (appid1 varchar(256), appid2 char(20))
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@test_a
+PREHOOK: query: INSERT INTO test_a VALUES ('2882303761517473127',
'2882303761517473127'), ('2882303761517473276','2882303761517473276')
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@test_a
+POSTHOOK: query: INSERT INTO test_a VALUES ('2882303761517473127',
'2882303761517473127'), ('2882303761517473276','2882303761517473276')
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@test_a
+POSTHOOK: Lineage: test_a.appid1 SCRIPT []
+POSTHOOK: Lineage: test_a.appid2 SCRIPT []
+WARNING: Comparing a bigint and a varchar(256) may result in a loss of
precision.
+PREHOOK: query: SELECT appid1 FROM test_a WHERE appid1 = 2882303761517473127
+PREHOOK: type: QUERY
+PREHOOK: Input: default@test_a
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT appid1 FROM test_a WHERE appid1 = 2882303761517473127
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@test_a
+#### A masked pattern was here ####
+2882303761517473127
+2882303761517473276
Review comment:
this test is now removed. The test wants to prove that comparing a
bigint and a (var)char may result in a loss of precision, which produces a
confusing result.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 426583)
Time Spent: 50m (was: 40m)
> Unsafe comparing bigints and chars
> ----------------------------------
>
> Key: HIVE-23269
> URL: https://issues.apache.org/jira/browse/HIVE-23269
> Project: Hive
> Issue Type: Improvement
> Affects Versions: 4.0.0
> Reporter: Zhihua Deng
> Priority: Major
> Attachments: HIVE-23269.patch
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> 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)