Github user sergey-rubtsov commented on a diff in the pull request:
https://github.com/apache/spark/pull/21363#discussion_r189596275
--- 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 --
thanks
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]