hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aihua Xu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-11392) Trailing spaces in char comparisons
Date Wed, 29 Jul 2015 13:10:04 GMT

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

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

Got it. Thanks Jason.

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

Mime
View raw message