cloud-fan commented on code in PR #40678:
URL: https://github.com/apache/spark/pull/40678#discussion_r1160407865
##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala:
##########
@@ -104,6 +105,23 @@ abstract class JdbcDialect extends Serializable with
Logging {
*/
def getJDBCType(dt: DataType): Option[JdbcType] = None
+ /**
+ * Convert java.sql.Timestamp to a Long value (internal representation of a
TimestampNTZType)
+ * holding the microseconds since the epoch of 1970-01-01 00:00:00Z for this
timestamp.
+ */
+ def convertJavaTimestampToTimestampNTZ(t: Timestamp): Long = {
+ DateTimeUtils.fromJavaTimestampNoRebase(t)
+ }
+
+ /**
+ * Converts a LocalDateTime representing a TimestampNTZ type to an
+ * instance of `java.sql.Timestamp`.
+ */
+ def convertTimestampNTZToJavaTimestamp(ldt: LocalDateTime): Timestamp = {
Review Comment:
People can use `LocalDateTime.ofEpochSecond`, no need to specify year,
month, day, ... fields
--
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]