MaxGekk 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_r241349476
 
 

 ##########
 File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonSuite.scala
 ##########
 @@ -96,19 +99,26 @@ class JsonSuite extends QueryTest with SharedSQLContext 
with TestJsonData {
     checkTypePromotion(DateTimeUtils.fromJavaTimestamp(new 
Timestamp(intNumber.toLong * 1000L)),
         enforceCorrectType(intNumber.toLong, TimestampType))
     val strTime = "2014-09-30 12:34:56"
-    
checkTypePromotion(DateTimeUtils.fromJavaTimestamp(Timestamp.valueOf(strTime)),
-        enforceCorrectType(strTime, TimestampType))
+    checkTypePromotion(
+      expected = 1412080496000000L,
 
 Review comment:
   As far as I remember `"GMT"` is passed as default time zone to JSONOptions 
https://github.com/apache/spark/pull/23196/files#diff-fde14032b0e6ef8086461edf79a27c5dL67
 and this guy `DateTimeUtils.fromJavaTimestamp(Timestamp.valueOf(strTime)` does 
not care about any Spark settings and takes system timezone from jvm.

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