From reviews-return-633109-archive-asf-public=cust-asf.ponee.io@spark.apache.org Tue Apr 10 08:53:10 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9D42718064C for ; Tue, 10 Apr 2018 08:53:09 +0200 (CEST) Received: (qmail 32031 invoked by uid 500); 10 Apr 2018 06:53:08 -0000 Mailing-List: contact reviews-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@spark.apache.org Received: (qmail 32020 invoked by uid 99); 10 Apr 2018 06:53:07 -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; Tue, 10 Apr 2018 06:53:07 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DDA8EF4E0C; Tue, 10 Apr 2018 06:53:07 +0000 (UTC) From: viirya To: reviews@spark.apache.org Reply-To: reviews@spark.apache.org References: In-Reply-To: Subject: [GitHub] spark pull request #21010: [SPARK-23900][SQL] format_number support user spe... Content-Type: text/plain Message-Id: <20180410065307.DDA8EF4E0C@git1-us-west.apache.org> Date: Tue, 10 Apr 2018 06:53:07 +0000 (UTC) Github user viirya commented on a diff in the pull request: https://github.com/apache/spark/pull/21010#discussion_r180312765 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala --- @@ -2108,35 +2132,52 @@ case class FormatNumber(x: Expression, d: Expression) // SPARK-13515: US Locale configures the DecimalFormat object to use a dot ('.') // as a decimal separator. val usLocale = "US" - val i = ctx.freshName("i") val dFormat = ctx.freshName("dFormat") - val lastDValue = - ctx.addMutableState(CodeGenerator.JAVA_INT, "lastDValue", v => s"$v = -100;") val pattern = ctx.addMutableState(sb, "pattern", v => s"$v = new $sb();") --- End diff -- `pattern` is only needed for `IntegerType` case. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org For additional commands, e-mail: reviews-help@spark.apache.org