hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergio Peña (JIRA) <j...@apache.org>
Subject [jira] [Commented] (HIVE-13311) MetaDataFormatUtils throws NPE when HiveDecimal.create is null
Date Fri, 18 Mar 2016 16:28:33 GMT

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

Sergio Peña commented on HIVE-13311:
------------------------------------

Thanks [~sircodesalot]
+1

> MetaDataFormatUtils throws NPE when HiveDecimal.create is null
> --------------------------------------------------------------
>
>                 Key: HIVE-13311
>                 URL: https://issues.apache.org/jira/browse/HIVE-13311
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Reuben Kuhnert
>            Assignee: Reuben Kuhnert
>            Priority: Minor
>         Attachments: HIVE-13311.01.patch
>
>
> The {{MetadataFormatUtils.convertToString}} functions have guards to validate for when
valid is null, however the {{HiveDecimal.create}} can return null and will throw exceptions
when {{.toString()}} is called.
> {code}
>   private static String convertToString(Decimal val) {
>     if (val == null) {
>       return "";
>     }
>     // HERE: Will throw NPE when HiveDecimal.create returns null.
>     return HiveDecimal.create(new BigInteger(val.getUnscaled()), val.getScale()).toString();
>   }
> {code}



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

Mime
View raw message