You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (Jira)" <ji...@apache.org> on 2020/06/16 06:01:00 UTC

[jira] [Resolved] (SPARK-31986) Test failure RebaseDateTimeSuite."optimization of micros rebasing - Julian to Gregorian"

     [ https://issues.apache.org/jira/browse/SPARK-31986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wenchen Fan resolved SPARK-31986.
---------------------------------
    Fix Version/s: 3.1.0
                   3.0.1
       Resolution: Fixed

Issue resolved by pull request 28816
[https://github.com/apache/spark/pull/28816]

> Test failure RebaseDateTimeSuite."optimization of micros rebasing - Julian to Gregorian"
> ----------------------------------------------------------------------------------------
>
>                 Key: SPARK-31986
>                 URL: https://issues.apache.org/jira/browse/SPARK-31986
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.0.1, 3.1.0
>            Reporter: Maxim Gekk
>            Assignee: Maxim Gekk
>            Priority: Major
>             Fix For: 3.0.1, 3.1.0
>
>
> The test fails on 1945-09-14 23:30:00.0. The failure can be reproduced by modifying the test:
> {code:scala}
>   test("optimization of micros rebasing - Julian to Gregorian") {
>     outstandingZoneIds.filter(_.getId.contains("Hong"))foreach { zid =>
>       withClue(s"zone id = $zid") {
>         withDefaultTimeZone(zid) {
>           val start = rebaseGregorianToJulianMicros(
>             instantToMicros(LocalDateTime.of(1, 1, 1, 0, 0, 0).atZone(zid).toInstant))
>           val end = rebaseGregorianToJulianMicros(
>             instantToMicros(LocalDateTime.of(2100, 1, 1, 0, 0, 0).atZone(zid).toInstant))
>           var micros = -761211000000000L
>           do {
>             val rebased = rebaseJulianToGregorianMicros(zid, micros)
>             val rebasedAndOptimized = rebaseJulianToGregorianMicros(micros)
>             assert(rebasedAndOptimized === rebased)
>             micros += (MICROS_PER_DAY * 30 * (0.5 + Math.random())).toLong
>           } while (micros <= end)
>         }
>       }
>     }
>   }
> {code}
> {code}
> zone id = Asia/Hong_Kong -761211000000000 did not equal -761207400000000
> ScalaTestFailureLocation: org.apache.spark.sql.catalyst.util.RebaseDateTimeSuite at (RebaseDateTimeSuite.scala:236)
> Expected :-761207400000000
> Actual   :zone id = Asia/Hong_Kong -761211000000000
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org