cloud-fan commented on code in PR #58408:
URL: https://github.com/apache/spark/pull/58408#discussion_r3996963525


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala:
##########
@@ -2404,7 +2412,10 @@ case class FormatString(children: Expression*) extends 
Expression with ImplicitC
     val numArgLists = argListGen.length
     val argListCode = argListGen.zipWithIndex.map { case(v, index) =>
       val value =
-        if (CodeGenerator.boxedType(v._1) != CodeGenerator.javaType(v._1)) {
+        if (CodeGenerator.javaClass(v._1) == classOf[Decimal]) {

Review Comment:
   **Non-blocking (P2):** FormatString admits a BoundReference declared as 
ObjectType(classOf[Object]) whose row value is a Spark Decimal. The interpreted 
path converts that runtime value to java.math.BigDecimal, but this generated 
path checks only the declared Java class and passes the raw Decimal to 
Formatter, so %f succeeds interpreted and throws 
IllegalFormatConversionException under codegen. Please make generated 
conversion runtime-aware for broad object types and add an interpreted/codegen 
regression for this case.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to