srowen commented on a change in pull request #24889: [SPARK-28072][SQL] Use 
`Iso8601TimestampFormatter` in `FromUnixTime` codegen to fix ICCE in JDK9+
URL: https://github.com/apache/spark/pull/24889#discussion_r294385475
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
 ##########
 @@ -859,11 +859,11 @@ case class FromUnixTime(sec: Expression, format: 
Expression, timeZoneId: Option[
     } else {
       val zid = ctx.addReferenceObj("zoneId", zoneId, classOf[ZoneId].getName)
       val locale = ctx.addReferenceObj("locale", Locale.US)
-      val tf = TimestampFormatter.getClass.getName.stripSuffix("$")
+      val tf = classOf[Iso8601TimestampFormatter].getName
       nullSafeCodeGen(ctx, ev, (seconds, f) => {
         s"""
         try {
-          ${ev.value} = UTF8String.fromString($tf.apply($f.toString(), $zid, 
$locale).
 
 Review comment:
   This is Java code that Janino's compiling. Still, 
`TimestampFormatter.apply()` seemed legal in some test Java class I tried 
locally. OK yeah, I mean it might be a Janino thing not Scala, right. There is 
a slightly newer janino (3.0.12 vs 3.0.11) but I don't see any relevant fixes.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to