[ 
https://issues.apache.org/jira/browse/HIVE-11392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14645010#comment-14645010
 ] 

Aihua Xu commented on HIVE-11392:
---------------------------------

[~jdere] This seems to be an issue. We should return the result always since 
the trailing space is not important during the comparison, right?

> 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)

Reply via email to