peter-toth edited a comment on pull request #34693:
URL: https://github.com/apache/spark/pull/34693#issuecomment-977671500


   > > This change also seem to work with MSSQL's temp table syntax:
   > > ```
   > > val withClause = "(SELECT * INTO #TempTable FROM (SELECT * FROM tbl 
WHERE x > 10) t)"
   > > val query = "SELECT * FROM #TempTable"
   > > val df = spark.read.format("jdbc")
   > >   .option("url", jdbcUrl)
   > >   .option("withClause", withClause)
   > >   .option("query", query)
   > >   .load()
   > > ```
   > 
   > Since it also works with temp table syntax, do you think it would be a 
good idea to include it the title of this PR and modify the title to "Support 
CTE and TempTable queries with MSSQL JDBC"?
   
   Thanks, makes sense. I've modified PR title and description and added a new 
test in: 
https://github.com/apache/spark/pull/34693/commits/dea730a12503328b98375cf4d4590444db31d090
   
   Actually, I wonder if it makes sense to rename `withClause` to a more 
general `queryPrefix` option.


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