aleksandar-trajkovic-db commented on code in PR #58203:
URL: https://github.com/apache/spark/pull/58203#discussion_r3870635219


##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/OracleDialect.scala:
##########
@@ -181,10 +182,26 @@ private case class OracleDialect() extends JdbcDialect 
with SQLConfHelper with N
       case BINARY_DOUBLE => Some(DoubleType) // Value for 
OracleTypes.BINARY_DOUBLE
       case INTERVAL_YM => Some(YearMonthIntervalType())
       case INTERVAL_DS => Some(DayTimeIntervalType())
+      case Types.TIMESTAMP if !conf.legacyOracleTimestampNTZMappingEnabled && 
typeName != null &&
+          typeName.toUpperCase(Locale.ROOT).matches("DATE|TIMESTAMP") =>
+        // Oracle DATE and TIMESTAMP are zoneless (both report typeName 
DATE/TIMESTAMP under
+        // Types.TIMESTAMP), so NTZ is faithful; WITH [LOCAL] TIME ZONE hits 
the -101/-102 case.
+        Some(TimestampNTZType)
       case _ => None
     }
   }
 
+  // Preserve the zoneless wall-clock: the driver decoded the Timestamp in the 
JVM zone, and
+  // toLocalDateTime reads those same fields back, rather than rebasing 
through UTC. Mirrors
+  // PostgresDialect.
+  override def convertJavaTimestampToTimestampNTZ(t: Timestamp): LocalDateTime 
= {

Review Comment:
   Good catch, fixed, so that the legacy flag returns the old behavior 



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