abir123rajbongshi-debug commented on code in PR #60609:
URL: https://github.com/apache/spark/pull/60609#discussion_r4601064754


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCOptions.scala:
##########
@@ -283,6 +284,14 @@ class JDBCOptions(
       .map(_.toBoolean)
       .getOrElse(dialectTimestampNTZAsWallClock)
 
+  // Time zone the source renders TimestampType values in. When set, reads and 
writes pass a
+  // calendar in this zone to ResultSet.getTimestamp and 
PreparedStatement.setTimestamp, so
+  // offset-less driver values are not interpreted in the JVM default time 
zone.
+  val timestampCalendarTimeZone: Option[TimeZone] =
+    parameters
+      .get(JDBC_TIMESTAMP_CALENDAR_TIME_ZONE)
+      .map(id => TimeZone.getTimeZone(ZoneId.of(id)))

Review Comment:
   Done, it now uses DateTimeUtils.getTimeZone, so PST/+5:30 work and invalid 
zones raise INVALID_TIMEZONE.



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

Reply via email to