Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions core/src/test/scala/org/apache/spark/SparkFunSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package org.apache.spark

// scalastyle:off
import java.io.File
import java.util.TimeZone

import org.scalatest.{BeforeAndAfterAll, FunSuite, Outcome}

Expand Down Expand Up @@ -106,4 +107,14 @@ abstract class SparkFunSuite
}
}

lazy val outstandingTimezones = Seq(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this lazy so that it's not evaluated by each test suite? I get it although TimeZone caches these, it seems. It won't matter really either way. I'm neutral, it doesn't matter

TimeZone.getTimeZone("UTC"),
TimeZone.getTimeZone("PST"),
TimeZone.getTimeZone("CET"),
TimeZone.getTimeZone("Africa/Dakar"),
TimeZone.getTimeZone("America/Los_Angeles"),
TimeZone.getTimeZone("Antarctica/Vostok"),
TimeZone.getTimeZone("Asia/Hong_Kong"),
TimeZone.getTimeZone("Europe/Amsterdam"))

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import org.apache.spark.SparkFunSuite
import org.apache.spark.sql.catalyst.InternalRow
import org.apache.spark.sql.catalyst.errors.TreeNodeException
import org.apache.spark.sql.catalyst.plans.PlanTestBase
import org.apache.spark.sql.catalyst.util.{ArrayBasedMapData, DateTimeTestUtils, DateTimeUtils, GenericArrayData, PermissiveMode}
import org.apache.spark.sql.catalyst.util._
import org.apache.spark.sql.internal.SQLConf
import org.apache.spark.sql.types._
import org.apache.spark.unsafe.types.UTF8String
Expand Down Expand Up @@ -510,7 +510,7 @@ class JsonExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper with
)

val jsonData2 = """{"t": "2016-01-01T00:00:00"}"""
for (tz <- DateTimeTestUtils.ALL_TIMEZONES) {
for (tz <- outstandingTimezones) {
c = Calendar.getInstance(tz)
c.set(2016, 0, 1, 0, 0, 0)
c.set(Calendar.MILLISECOND, 0)
Expand Down