Github user viirya commented on a diff in the pull request: https://github.com/apache/spark/pull/21363#discussion_r189487172 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala --- @@ -143,6 +145,12 @@ object DateTimeUtils { millisLocal - getOffsetFromLocalMillis(millisLocal, timeZone) } + def dateTimeToMicroseconds(localDateTime: LocalDateTime, timeZone: TimeZone): Long = { + val microOfSecond = localDateTime.getLong(ChronoField.MICRO_OF_SECOND) + val epochSecond = localDateTime.atZone(timeZone.toZoneId).toInstant.getEpochSecond + epochSecond * 1000000L + microOfSecond --- End diff -- `1000000L` -> `MICROS_PER_SECOND`?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org