MaxGekk commented on a change in pull request #33346:
URL: https://github.com/apache/spark/pull/33346#discussion_r670135296
##########
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)
@gengliangwang This is wrong. You should take into account all runs in forks
(not only OSS).
> Actually the current_timestamp test has the same DST issue ...
@cloud-fan Don't think so. Could you explain me, please, how the result of
`current_timestamp` is shifted during DST.
FYI, I have already fixed a few tests during DST. You can look for fixes to
OSS during LA DST, like https://github.com/apache/spark/pull/27474
--
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]