Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-31986

Test failure RebaseDateTimeSuite."optimization of micros rebasing - Julian to Gregorian"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.1, 3.1.0
    • 3.0.1, 3.1.0
    • SQL
    • None

    Description

      The test fails on 1945-09-14 23:30:00.0. The failure can be reproduced by modifying the test:

        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)
              }
            }
          }
        }
      
      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
      

      Attachments

        Activity

          People

            maxgekk Max Gekk
            maxgekk Max Gekk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: