From dev-return-34847-archive-asf-public=cust-asf.ponee.io@drill.apache.org Wed Jan 10 21:07:12 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id CD95618072F for ; Wed, 10 Jan 2018 21:07:12 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id BD91A160C41; Wed, 10 Jan 2018 20:07:12 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 05C88160C1E for ; Wed, 10 Jan 2018 21:07:11 +0100 (CET) Received: (qmail 19417 invoked by uid 500); 10 Jan 2018 20:07:11 -0000 Mailing-List: contact dev-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list dev@drill.apache.org Received: (qmail 19405 invoked by uid 99); 10 Jan 2018 20:07:10 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jan 2018 20:07:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 93F0DDFB6E; Wed, 10 Jan 2018 20:07:10 +0000 (UTC) From: daveoshinsky To: dev@drill.apache.org Reply-To: dev@drill.apache.org References: In-Reply-To: Subject: [GitHub] drill pull request #570: DRILL-4834 decimal implementation is vulnerable to ... Content-Type: text/plain Message-Id: <20180110200710.93F0DDFB6E@git1-us-west.apache.org> Date: Wed, 10 Jan 2018 20:07:10 +0000 (UTC) Github user daveoshinsky commented on a diff in the pull request: https://github.com/apache/drill/pull/570#discussion_r160785721 --- Diff: exec/java-exec/src/main/codegen/templates/SqlAccessors.java --- @@ -127,6 +127,25 @@ public String getString(int index) { } <#break> + <#case "VarDecimal"> + + @Override + public String getString(int index){ +<#if mode=="Nullable"> + if(ac.isNull(index)){ + return null; + } + + try { --- End diff -- The getString method can throw NumberFormatException for BigDecimal, according to javadoc https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html. Should it just throw the exception? If yes, I';ll remove the try/catch. ---