hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Shelukhin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-14281) Issue in decimal multiplication
Date Mon, 25 Jul 2016 18:05:20 GMT

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

Sergey Shelukhin commented on HIVE-14281:
-----------------------------------------

I think as long as the derivation method is well defined it should be ok to return null or
fail for values that don't fit. There's no good way to derive result type from the data in
advance...

> Issue in decimal multiplication
> -------------------------------
>
>                 Key: HIVE-14281
>                 URL: https://issues.apache.org/jira/browse/HIVE-14281
>             Project: Hive
>          Issue Type: Bug
>          Components: Types
>            Reporter: Chaoyu Tang
>            Assignee: Chaoyu Tang
>
> {code}
> CREATE TABLE test (a DECIMAL(38,18), b DECIMAL(38,18));
> INSERT OVERWRITE TABLE test VALUES (20, 20);
> SELECT a*b from test
> {code}
> The returned result is NULL (instead of 400)
> It is because Hive adds the scales from operands and the type for a*b is set to decimal
(38, 36). Hive could not handle this case properly (e.g. by rounding)



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

Mime
View raw message