HyukjinKwon commented on code in PR #36726:
URL: https://github.com/apache/spark/pull/36726#discussion_r884667716
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCOptions.scala:
##########
@@ -226,6 +226,9 @@ class JDBCOptions(
// The prefix that is added to the query sent to the JDBC database.
// This is required to support some complex queries with some JDBC databases.
val prepareQuery = parameters.get(JDBC_PREPARE_QUERY).map(_ + "
").getOrElse("")
+
+ // Infers timestamp values as TimestampNTZ type when reading data.
+ val inferTimestampNTZType = parameters.getOrElse(JDBC_INFER_TIMESTAMP_NTZ,
"false").toBoolean
Review Comment:
Should we maybe check if `spark.sql.timestampType` is `TIMESTAMP_NTZ` if
`inferTimestampNTZType` is not set? That's how CSV type inference and Python
type inference do.
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCOptions.scala:
##########
@@ -226,6 +226,9 @@ class JDBCOptions(
// The prefix that is added to the query sent to the JDBC database.
// This is required to support some complex queries with some JDBC databases.
val prepareQuery = parameters.get(JDBC_PREPARE_QUERY).map(_ + "
").getOrElse("")
+
+ // Infers timestamp values as TimestampNTZ type when reading data.
+ val inferTimestampNTZType = parameters.getOrElse(JDBC_INFER_TIMESTAMP_NTZ,
"false").toBoolean
Review Comment:
cc @gengliangwang FYI
--
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]