cloud-fan commented on a change in pull request #27618: [SPARK-30869][SQL] Convert dates to/from timestamps in microseconds precision URL: https://github.com/apache/spark/pull/27618#discussion_r382404073
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala ########## @@ -131,10 +131,12 @@ case class CurrentBatchTimestamp( */ override protected def evalInternal(input: InternalRow): Any = toLiteral.value - def toLiteral: Literal = dataType match { - case _: TimestampType => - Literal(DateTimeUtils.fromJavaTimestamp(new Timestamp(timestampMs)), TimestampType) - case _: DateType => Literal(DateTimeUtils.millisToDays(timestampMs, zoneId), DateType) + def toLiteral: Literal = { + val timestampUs = fromMillis(timestampMs) Review comment: `fromMillis` is not a good name, how about `millisToMicros`? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org