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

   ### What changes were proposed in this pull request?
   
   Add missing method overrides in `AggregatedDialect` that delegate to the 
underlying dialects, fixing cases where the generic `JdbcDialect` default is 
used instead of the database-specific implementation.
   
   Methods now properly delegated:
   - `compileValue` — the reported bug (Oracle timestamps formatted incorrectly)
   - `compileExpression` — SQL expression pushdown
   - `isSupportedFunction` — function pushdown support (returns true if any 
dialect supports it)
   - `getJdbcSQLQueryBuilder` — SQL query builder
   - `supportsLimit` / `supportsOffset` / `supportsHint` / `supportsJoin` — 
query capability flags
   - `getLimitClause` / `getOffsetClause` — SQL clause generation
   - `classifyException` — error classification
   - `renameTable` — DDL generation
   - `functions` — custom SQL functions
   - `createConnectionFactory` — connection creation
   
   ### Why are the changes needed?
   
   When a user registers a custom JDBC dialect alongside a built-in one (e.g., 
Oracle), Spark combines them into an `AggregatedDialect`. However, 
`AggregatedDialect` only delegated ~11 methods to the underlying dialects — the 
rest fell through to the generic `JdbcDialect` defaults. This caused 
database-specific behavior (like Oracle's timestamp literal formatting) to be 
silently dropped, producing invalid SQL.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Users with custom JDBC dialects registered alongside built-in dialects 
will now get correct database-specific SQL generation for all delegated 
methods, instead of generic defaults that may produce invalid SQL.
   
   ### How was this patch tested?
   
   Added a new test "Aggregated dialects: delegation of compileValue and other 
methods" in `JDBCSuite.scala` that verifies `compileValue`, 
`isSupportedFunction`, `supportsLimit`, `supportsOffset`, `getLimitClause`, and 
`getOffsetClause` are properly delegated through the aggregated dialect.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generative AI tooling (Claude Code) was used as an assistive tool for 
implementation guidance.


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