urosstan-db commented on code in PR #58536:
URL: https://github.com/apache/spark/pull/58536#discussion_r4055091975


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRelation.scala:
##########
@@ -216,26 +217,22 @@ private[sql] object JDBCRelation extends Logging {
   private def toBoundValueInWhereClause(
       value: Long,
       columnType: DataType,
-      timeZoneId: String): String = {
-    def dateTimeToString(): String = {
-      val dateTimeStr = columnType match {
+      timeZoneId: String,
+      dialect: JdbcDialect): String = {
+    def compileDateTimeValue(): String = {
+      val dateTimeValue = columnType match {
         case DateType =>
-          DateFormatter().format(value.toInt)
+          java.sql.Date.valueOf(DateTimeUtils.daysToLocalDate(value.toInt))

Review Comment:
   nit: can you do full import?



##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRelation.scala:
##########
@@ -216,26 +217,22 @@ private[sql] object JDBCRelation extends Logging {
   private def toBoundValueInWhereClause(
       value: Long,
       columnType: DataType,
-      timeZoneId: String): String = {
-    def dateTimeToString(): String = {
-      val dateTimeStr = columnType match {
+      timeZoneId: String,
+      dialect: JdbcDialect): String = {
+    def compileDateTimeValue(): String = {
+      val dateTimeValue = columnType match {
         case DateType =>
-          DateFormatter().format(value.toInt)
+          java.sql.Date.valueOf(DateTimeUtils.daysToLocalDate(value.toInt))

Review Comment:
   nit: can you do import in header?



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