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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to