hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Dere (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-8488) hash() doesn't match between string and char/varchar
Date Thu, 16 Oct 2014 19:46:34 GMT

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

Jason Dere commented on HIVE-8488:
----------------------------------

hash() uses ObjectInspectorUtils.hashCode(), which has special case handling for Text so that
the hashcode matches String.hashCode(). This special case handling should have been done for
char/varchar as well.
Note that fixing this will break existing behavior of hash() for char/varchar.

> hash() doesn't match between string and char/varchar
> ----------------------------------------------------
>
>                 Key: HIVE-8488
>                 URL: https://issues.apache.org/jira/browse/HIVE-8488
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>            Reporter: Jason Dere
>            Assignee: Jason Dere
>
> {noformat}
> hive> select * from tab1;
> OK
> val_484	val_484	val_484
> hive> select hash(c1), hash(c2), hash(c3) from tab1;
> OK
> 230901778	1973712113	1973712113
> {noformat}
> This may throw off users expecting string/varchar/char types to be fairly interchangeable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message