beliefer opened a new pull request, #39667: URL: https://github.com/apache/spark/pull/39667
### What changes were proposed in this pull request? Currently, JDBCRDD uses fixed format for SELECT statement. ``` val sqlText = options.prepareQuery + s"SELECT $columnList FROM ${options.tableOrQuery} $myTableSampleClause" + s" $myWhereClause $getGroupByClause $getOrderByClause $myLimitClause $myOffsetClause" ``` But some databases have different syntax that uses different keyword or sort. For example, MS SQL Server uses keyword TOP to describe LIMIT clause or Top N. The LIMIT clause of MS SQL Server. ``` SELECT TOP(1) Model, Color, Price FROM dbo.Cars WHERE Color = 'blue' ``` The Top N of MS SQL Server. ``` SELECT TOP(1) Model, Color, Price FROM dbo.Cars WHERE Color = 'blue' ORDER BY Price ASC ``` Their PR will let JDBC dialect could define the special syntax own. ### Why are the changes needed? Extract the function that construct the select statement for JDBC dialect. ### Does this PR introduce _any_ user-facing change? 'No'. New feature. ### How was this patch tested? N/A -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org