Aihua Xu created HIVE-11392:
-------------------------------
Summary: Trailing spaces in char comparisons
Key: HIVE-11392
URL: https://issues.apache.org/jira/browse/HIVE-11392
Project: Hive
Issue Type: Bug
Components: Hive
Affects Versions: 2.0.0
Reporter: Aihua Xu
Following on HIVE-3745, for char type, hive should ignore trailing spaces for
comparison while it seems not the case.
{noformat}
create table chtest (a char(4));
insert into chtest values ('1');
select * from chtest where a='1'; # no whitespace, produces result
select * from chtest where a='1 '; # 2 spaces, no result
select * from chtest where a='1 '; # 3 spaces, no result
select * from chtest where a=cast('1 ' as char(4)); # any amount of spaces,
cast to char of same length, produces result
{noformat}
It's not consistent.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)