microsoft / sql-spark-connector

Apache Spark Connector for SQL Server and Azure SQL
Apache License 2.0
273 stars 116 forks source link

[Question] how to set MAXDOP #237

Open guoliqiang opened 1 year ago

guoliqiang commented 1 year ago

Hi Team, when I query data from SQL server, if I intent to control the CPU usage, I always use

select * from XXX option (MAXDOP 1)

How to achieve this by spark sql connector?

I tried to pass above query through option("query"), it throws a syntax error.

java.lang.Error: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'OPTION'.