MaxGekk commented on a change in pull request #33346:
URL: https://github.com/apache/spark/pull/33346#discussion_r669844676
##########
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:
What if the test runs during daylight saving time? So, the diff can be 1
hour.
--
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]