charliec05 opened a new pull request, #58536:
URL: https://github.com/apache/spark/pull/58536

   ### What changes were proposed in this pull request?
   
   Resolve the JDBC dialect while constructing column partitions and route 
temporal partition-bound values through `JdbcDialect.compileValue`.
   
   Date bounds are converted to `java.sql.Date`, while timestamp and 
timestamp-without-time-zone bounds are converted to `LocalDateTime` values that 
preserve the existing configured-zone and zoneless semantics. Numeric bounds 
are unchanged.
   
   Add regression coverage for `DateType`, `TimestampType`, and 
`TimestampNTZType` using the Oracle dialect.
   
   ### Why are the changes needed?
   
   Temporal partition bounds are currently emitted as bare quoted ISO strings, 
bypassing the configured JDBC dialect. Databases do not universally accept 
those literals. In particular, Oracle may interpret them according to session 
NLS formats, while its dialect already provides portable JDBC date and 
timestamp escape literals through `compileValue`.
   
   Using the dialect makes generated partition predicates valid for the target 
database and reuses the existing literal compilation extension point.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. JDBC partition predicates for date and timestamp columns now use 
dialect-compiled literals. For example, Oracle bounds use `{d '...'}` and `{ts 
'...'}` instead of bare quoted strings.
   
   ### How was this patch tested?
   
   Added regression coverage for all three temporal partition types and ran:
   
   `build/sbt "sql/Test/testOnly org.apache.spark.sql.jdbc.JDBCSuite"`
   
   All 153 tests passed. The focused test was rerun after the final formatting 
adjustment. Also ran `dev/lint-scala`; Scalastyle and Scalafmt passed.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: OpenAI Codex (GPT-5)
   


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