MaxGekk commented on a change in pull request #23358: [SPARK-26424][SQL] Use
java.time API in date/timestamp expressions
URL: https://github.com/apache/spark/pull/23358#discussion_r243706706
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
##########
@@ -677,16 +679,16 @@ abstract class UnixTime
} else {
left.dataType match {
case DateType =>
- DateTimeUtils.daysToMillis(t.asInstanceOf[Int], timeZone) / 1000L
+ DateTimeUtils.daysToMillis(t.asInstanceOf[Int], timeZone) /
MILLIS_PER_SECOND
case TimestampType =>
- t.asInstanceOf[Long] / 1000000L
+ t.asInstanceOf[Long] / MICROS_PER_SECOND
case StringType if right.foldable =>
if (constFormat == null || formatter == null) {
null
} else {
try {
formatter.parse(
- t.asInstanceOf[UTF8String].toString).getTime / 1000L
+ t.asInstanceOf[UTF8String].toString) / MICROS_PER_SECOND
Review comment:
For now, `parse()` returns microseconds
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]