gengliangwang commented on a change in pull request #32814:
URL: https://github.com/apache/spark/pull/32814#discussion_r647973376
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
##########
@@ -634,6 +634,39 @@ class DateTimeUtilsSuite extends SparkFunSuite with
Matchers with SQLHelper {
}
}
+ test("SPARK-35099: microseconds to LocalDateTime") {
Review comment:
Done, thanks.
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
##########
@@ -634,6 +634,39 @@ class DateTimeUtilsSuite extends SparkFunSuite with
Matchers with SQLHelper {
}
}
+ test("SPARK-35099: microseconds to LocalDateTime") {
+ assert(microsToLocalDateTime(0) ==
LocalDateTime.parse("1970-01-01T00:00:00"))
+ assert(microsToLocalDateTime(100) ==
LocalDateTime.parse("1970-01-01T00:00:00.0001"))
+ assert(microsToLocalDateTime(100000000) ==
LocalDateTime.parse("1970-01-01T00:01:40"))
+ assert(microsToLocalDateTime(100000000000L) ==
LocalDateTime.parse("1970-01-02T03:46:40"))
+ assert(microsToLocalDateTime(253402300799999999L) ==
+ LocalDateTime.parse("9999-12-31T23:59:59.999999"))
+ assert(microsToLocalDateTime(Long.MinValue) ==
+ LocalDateTime.parse("-290308-12-21T19:59:05.224192"))
+ assert(microsToLocalDateTime(Long.MaxValue) ==
+ LocalDateTime.parse("+294247-01-10T04:00:54.775807"))
+ }
+
+ test("SPARK-35099: LocalDateTime to microseconds") {
Review comment:
Done, thanks.
--
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]