You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/04/17 22:41:07 UTC

[GitHub] [spark] rednaxelafx commented on a change in pull request #24392: [SPARK-27423][SQL][FOLLOWUP] Minor polishes to Cast codegen templates for Date <-> Timestamp

rednaxelafx commented on a change in pull request #24392: [SPARK-27423][SQL][FOLLOWUP] Minor polishes to Cast codegen templates for Date <-> Timestamp 
URL: https://github.com/apache/spark/pull/24392#discussion_r276460647
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
 ##########
 @@ -1028,7 +1029,7 @@ case class Cast(child: Expression, dataType: DataType, timeZoneId: Option[String
       from: DataType,
       ctx: CodegenContext): CastFunction = from match {
     case StringType =>
-      val zid = ctx.addReferenceObj("zoneId", zoneId, "java.time.ZoneId")
+      val zid = ctx.addReferenceObj("zoneId", zoneId, classOf[ZoneId].getName)
 
 Review comment:
   Thanks for the comment, @kiszk -san!
   
   I actually debated a bit with myself before sending out the PR. I was leaning towards the minimal change here, but since `zid` is used immedately in a `code` block, you're right that for style consistency we should wrap this in a `JavaCode.global`.
   
   Actually I'm curious why this line of code didn't trigger the need to use `inline` when interpolating the string...

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org