hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt McCline (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-14863) Decimal to int conversion produces incorrect values
Date Fri, 30 Sep 2016 22:17:20 GMT

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

Matt McCline commented on HIVE-14863:
-------------------------------------

Checkout CastDecimalToLong.  It even as a "lossy" TODO

AnyIntegerFromDecimalTreeReader in ConvertTreeReader has a lossy comment, too, but actually
the downCastAnyInteger some of the right thing and makes it a null if the long doesn't fit.  However,
if the longValue function of HiveDecimal returns a truncated long value, then we do the wrong
thing.

> Decimal to int conversion produces incorrect values
> ---------------------------------------------------
>
>                 Key: HIVE-14863
>                 URL: https://issues.apache.org/jira/browse/HIVE-14863
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Sergey Shelukhin
>            Assignee: Sergey Shelukhin
>            Priority: Critical
>         Attachments: HIVE-14863.patch
>
>
> {noformat}
> > select cast(cast ('111111111111111' as decimal(38,0)) as int);
> OK
> 307163591
> {noformat}



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

Mime
View raw message