cloud-fan commented on a change in pull request #23196: [SPARK-26243][SQL] Use 
java.time API for parsing timestamps and dates from JSON
URL: https://github.com/apache/spark/pull/23196#discussion_r241255540
 
 

 ##########
 File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/util/DateTimeFormatterSuite.scala
 ##########
 @@ -20,22 +20,24 @@ package org.apache.spark.sql.util
 import java.util.{Locale, TimeZone}
 
 import org.apache.spark.SparkFunSuite
+import org.apache.spark.sql.catalyst.plans.SQLHelper
 import org.apache.spark.sql.catalyst.util.{DateFormatter, DateTimeFormatter, 
DateTimeTestUtils}
+import org.apache.spark.sql.internal.SQLConf
 
-class DateTimeFormatterSuite  extends SparkFunSuite {
-  test("parsing dates using time zones") {
+class DateTimeFormatterSuite  extends SparkFunSuite with SQLHelper {
+  test("parsing dates") {
     val localDate = "2018-12-02"
     val expectedDays = Map(
       "UTC" -> 17867,
       "PST" -> 17867,
-      "CET" -> 17866,
+      "CET" -> 17867,
       "Africa/Dakar" -> 17867,
       "America/Los_Angeles" -> 17867,
-      "Antarctica/Vostok" -> 17866,
-      "Asia/Hong_Kong" -> 17866,
-      "Europe/Amsterdam" -> 17866)
+      "Antarctica/Vostok" -> 17867,
+      "Asia/Hong_Kong" -> 17867,
+      "Europe/Amsterdam" -> 17867)
     DateTimeTestUtils.outstandingTimezonesIds.foreach { timeZone =>
-      val formatter = DateFormatter("yyyy-MM-dd", 
TimeZone.getTimeZone(timeZone), Locale.US)
+      val formatter = DateFormatter("yyyy-MM-dd", Locale.US)
       val daysSinceEpoch = formatter.parse(localDate)
       assert(daysSinceEpoch === expectedDays(timeZone))
 
 Review comment:
   how about `assert(daysSinceEpoch === 17867)`? then we can remove that map.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to