Description
STEP 1. Create and upload test data
Execute in command line:
nano stest.data
Add to file:
000126,000777 000126,000778 000126,000779 000474,000888 000468,000889 000272,000880
hadoop fs -put stest.data /
hive> create table stest(x STRING, y STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY ','; hive> LOAD DATA INPATH '/stest.data' OVERWRITE INTO TABLE stest;
STEP 2. Execute test query (with cast for x)
select x from stest where cast(x as int) = 126;
EXPECTED RESULT:
000126 000126 000126
ACTUAL RESULT:
126 126 126
STEP 3. Execute test query (no cast for x)
hive> select x from stest where x = 126;
EXPECTED RESULT:
000126 000126 000126
ACTUAL RESULT:
126 126 126
In steps #2, #3 I expected '000126' because the origin type of x is STRING in stest table.
Note, setting hive.optimize.constant.propagation=false fixes the issue.
hive> set hive.optimize.constant.propagation=false; hive> select x from stest where x = 126; OK 000126 000126 000126
Related to HIVE-11104, HIVE-8555
Attachments
Attachments
Issue Links
- incorporates
-
HIVE-13197 Add adapted constprog2.q and constprog_partitioner.q tests back
- Closed
- is related to
-
HIVE-15106 Hive 1.0 returning only date part of a timestamp
- Open