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/02/25 17:24:13 UTC

[GitHub] kiszk commented on a change in pull request #23878: [SPARK-26978][CORE][SQL] Avoid magic time constants

kiszk commented on a change in pull request #23878: [SPARK-26978][CORE][SQL] Avoid magic time constants
URL: https://github.com/apache/spark/pull/23878#discussion_r259932271
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
 ##########
 @@ -927,7 +929,8 @@ case class Cast(child: Expression, dataType: DataType, timeZoneId: Option[String
       val tz = JavaCode.global(ctx.addReferenceObj("timeZone", timeZone), timeZone.getClass)
       (c, evPrim, evNull) =>
         code"""$evPrim =
-          org.apache.spark.sql.catalyst.util.DateTimeUtils.millisToDays($c / 1000L, $tz);"""
+          org.apache.spark.sql.catalyst.util.DateTimeUtils.millisToDays(
 
 Review comment:
   I have a little bit concern to use a method call in the generated code. This change includes # of Java bytecode to be generated while the original code uses `/` for long type.  
   Do we take the readability and maintanance or smaller generated bytecode?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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