gengliangwang commented on a change in pull request #33346:
URL: https://github.com/apache/spark/pull/33346#discussion_r670102683



##########
File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala
##########
@@ -98,10 +98,10 @@ class DateExpressionsSuite extends SparkFunSuite with 
ExpressionEvalHelper {
 
   test("datetime function localtimestamp") {
     outstandingTimezonesIds.foreach { zid =>
+      val zoneId = DateTimeUtils.getZoneId(zid)
       val ct = LocalTimestamp(Some(zid)).eval(EmptyRow).asInstanceOf[Long]
-      val t1 = DateTimeUtils.localDateTimeToMicros(
-        LocalDateTime.now(DateTimeUtils.getZoneId(zid)))
-      assert(math.abs(t1 - ct) < 5000)
+      val t1 = DateTimeUtils.localDateTimeToMicros(LocalDateTime.now(zoneId))
+      assert(math.abs(t1 - ct) < 1000000)

Review comment:
       If the execution time is 8ms, the chance to hit daylight saving time is 
less than 8/(365 * 24 * 3600 * 1000)..The operation should be finished in 1 
second. I can filter "PST" and "LA" if you really want to avoid it. WDYT?




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to