Return-Path: X-Original-To: apmail-hive-issues-archive@minotaur.apache.org Delivered-To: apmail-hive-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 17C1818C71 for ; Fri, 18 Mar 2016 16:28:34 +0000 (UTC) Received: (qmail 30985 invoked by uid 500); 18 Mar 2016 16:28:34 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 30851 invoked by uid 500); 18 Mar 2016 16:28:33 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 30825 invoked by uid 99); 18 Mar 2016 16:28:33 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Mar 2016 16:28:33 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id B621D2C1F6D for ; Fri, 18 Mar 2016 16:28:33 +0000 (UTC) Date: Fri, 18 Mar 2016 16:28:33 +0000 (UTC) From: =?utf-8?Q?Sergio_Pe=C3=B1a_=28JIRA=29?= To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-13311) MetaDataFormatUtils throws NPE when HiveDecimal.create is null MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-13311?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1520= 1737#comment-15201737 ]=20 Sergio Pe=C3=B1a 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 vali= date 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 =3D=3D null) { > return ""; > } > // HERE: Will throw NPE when HiveDecimal.create returns null. > return HiveDecimal.create(new BigInteger(val.getUnscaled()), val.getS= cale()).toString(); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)