HyukjinKwon commented on a change in pull request #23417: 
[SPARK-26374][TEST][SQL] Enable TimestampFormatter in HadoopFsRelationTest
URL: https://github.com/apache/spark/pull/23417#discussion_r244668273
 
 

 ##########
 File path: 
sql/hive/src/test/scala/org/apache/spark/sql/sources/HadoopFsRelationTest.scala
 ##########
 @@ -138,7 +137,8 @@ abstract class HadoopFsRelationTest extends QueryTest with 
SQLTestUtils with Tes
           logInfo(s"Testing $dataType data type$extraMessage")
 
           val extraOptions = Map[String, String](
-            "parquet.enable.dictionary" -> 
parquetDictionaryEncodingEnabled.toString
+            "parquet.enable.dictionary" -> 
parquetDictionaryEncodingEnabled.toString,
+            "timestampFormat" -> "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX"
 
 Review comment:
   Similar question was raised at 
https://github.com/apache/spark/pull/23417#discussion_r244549254. Looks this is 
going to be investigated soon separately.
   
   It's going to at least introduce some behaviour changes:
   
   ```scala
   scala> val fomatter = new 
org.apache.spark.sql.catalyst.util.Iso8601TimestampFormatter("yyyy-MM-dd'T'HH:mm:ss.SSSXXX",
 java.util.TimeZone.getDefault(), java.util.Locale.US)
   fomatter: org.apache.spark.sql.catalyst.util.Iso8601TimestampFormatter = 
org.apache.spark.sql.catalyst.util.Iso8601TimestampFormatter@2df019b8
   
   scala> fomatter.format(fomatter.parse("0015-03-10T08:53:43.591+07:30"))
   res0: String = 0015-03-10T08:19:08.591+06:55
   
   scala> val fomatter = new 
org.apache.spark.sql.catalyst.util.Iso8601TimestampFormatter("yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX",
 java.util.TimeZone.getDefault(), java.util.Locale.US)
   fomatter: org.apache.spark.sql.catalyst.util.Iso8601TimestampFormatter = 
org.apache.spark.sql.catalyst.util.Iso8601TimestampFormatter@763ff91
   
   scala> fomatter.format(fomatter.parse("0015-03-10T08:53:43.591+07:30"))
   res1: String = 0015-03-10T08:19:08.591+06:55:25
   ```
   

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