MaxGekk commented on a change in pull request #34638:
URL: https://github.com/apache/spark/pull/34638#discussion_r761659489
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonSuite.scala
##########
@@ -2746,6 +2746,182 @@ abstract class JsonSuite
}
}
+ test("SPARK-37360: Write and infer TIMESTAMP_NTZ values with a non-default
pattern") {
+ withTempPath { path =>
+ val exp = spark.sql("select timestamp_ntz'2020-12-12 12:12:12' as col0")
Review comment:
It is a dataset/dataframe not an expression, just in case.
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JsonInferSchema.scala
##########
@@ -144,6 +150,9 @@ private[sql] class JsonInferSchema(options: JSONOptions)
extends Serializable {
}
if (options.prefersDecimal && decimalTry.isDefined) {
decimalTry.get
+ } else if (options.inferTimestamp &&
Review comment:
Could you adjust the comment for inferTimestamp and mention the ntz type:
https://github.com/apache/spark/blob/1235bd29f087db834777cb9fc4c53a12e7f7d6b3/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JSONOptions.scala#L141
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]