peter-toth opened a new pull request #34693: URL: https://github.com/apache/spark/pull/34693
### What changes were proposed in this pull request? CTE queries are not supported with MSSQL server via JDBC as MSSQL server doesn't support statements with nested CTEs. When Spark builds the final query, that it will send via JDBC to the server, it wraps the original query (`options.tableOrQuery`) into parentheses in `JDBCRDD.resolveTable()` and `JDBCRDD.compute()`. Unfortunately, it is non-trivial to split an arbitrary query it into "with" and "regular" query clauses in `MsSqlServerDialect`. So instead, I'm proposing a new general JDBC option "withClause" that users can use if they have complex queries with CTE. ### Why are the changes needed? To support CTE queries with MSSQL. ### Does this PR introduce _any_ user-facing change? Yes, CTE queries are supported form now. ### How was this patch tested? Added new integration UTs. -- 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]
