dongjoon-hyun commented on code in PR #53046:
URL: https://github.com/apache/spark/pull/53046#discussion_r2525171030
##########
sql/connect/client/jdbc/src/main/scala/org/apache/spark/sql/connect/client/jdbc/SparkConnectResultSet.scala:
##########
@@ -162,8 +163,27 @@ class SparkConnectResultSet(
}
}
- override def getTimestamp(columnIndex: Int): Timestamp =
- throw new SQLFeatureNotSupportedException
+ override def getTimestamp(columnIndex: Int): Timestamp = {
+ getColumnValue(columnIndex, null: Timestamp) { idx =>
+ val value = currentRow.get(idx)
+ if (value == null) {
+ null
+ } else {
+ sparkResult.schema.fields(idx).dataType match {
+ case TimestampNTZType =>
+ // TIMESTAMP_NTZ is represented as LocalDateTime
+ Timestamp.valueOf(value.asInstanceOf[java.time.LocalDateTime])
Review Comment:
Just two questions.
- `spark.sql.session.timeZone` is used later?
- There is no need to use `DateTimeUtils.localDateTimeToMicros` or other
conversions?
--
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]