microsoft / sql-spark-connector

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

Add support for ORDER hint #45

Open yorek opened 3 years ago

yorek commented 3 years ago

BULK INSERT allow to specify if data already has a specific order so that Azure SQL / SQL Server can avoid sorting it again if inserting data into a clustered index.

https://docs.microsoft.com/en-us/sql/t-sql/statements/bulk-insert-transact-sql?view=sql-server-ver15

luxu1-ms commented 2 years ago

There is no implementation of order hints for SQLServerBulkCopy.class, SQLServerBulkCopyOptions.class. Thus it is not able to add hint support in spark mssql connector. I opened the issue below in MSSQL JDBC repo to ask the mssql jdbc team to support the order hints. https://github.com/microsoft/mssql-jdbc/issues/1481