Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
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 <- DateTimeTestUtils.outstandingTimezones) {
c = Calendar.getInstance(tz)
c.set(2016, 0, 1, 0, 0, 0)
c.set(Calendar.MILLISECOND, 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ object DateTimeTestUtils {

val ALL_TIMEZONES: Seq[TimeZone] = TimeZone.getAvailableIDs.toSeq.map(TimeZone.getTimeZone)

val outstandingTimezones: Seq[TimeZone] = Seq(
"UTC",
"PST",
"CET",
"Africa/Dakar",
"America/Los_Angeles",
"Antarctica/Vostok",
"Asia/Hong_Kong",
"Europe/Amsterdam").map(TimeZone.getTimeZone)

def withDefaultTimeZone[T](newDefaultTimeZone: TimeZone)(block: => T): T = {
val originalDefaultTimeZone = TimeZone.getDefault
try {
Expand Down