Open luxu1-ms opened 3 years ago
Hi @luxu1-ms , Thank you for the suggestion. The team will take a look into this.
Hi, any update on this issue
hi @luxu1-ms This issue is in our backlog. This will be triaged when we plan for the next semester.
Thanks.
Any updates on this?
hi @shivsood
This issue is still in our backlog. It didn't make the cut as we have to prioritize bug fixes and other features that are in higher demand. Please feel free to fill out our survey for features you would like to see in the driver we do look at the results when we do semester planning.
Would patches for this be accepted? it looks to be literally a couple of rows of changes since it's all in the query being send to sql server + new orderoption parameter to bulk copy options
Yes, we accept external PRs. Feel free to submit something, and we'll take a look.
Is your feature request related to a problem? If so, please give a short summary of the problem and how the feature would resolve it
Can you add support for order hints for bulk copy operations? I am going to add order hints for spark-mssql-connector but there is no implementation of order hints for SQLServerBulkCopy.class, SQLServerBulkCopyOptions.class
Describe the preferred solution
Describe alternatives you've considered
Additional context
Reference Documentations/Specifications
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.
ORDER ( { column [ ASC | DESC ] } [ ,... n ] ) Specifies how the data in the data file is sorted. Bulk import performance is improved if the data being imported is sorted according to the clustered index on the table, if any. If the data file is sorted in a different order, that is other than the order of a clustered index key or if there is no clustered index on the table, the ORDER clause is ignored. The column names supplied must be valid column names in the destination table. By default, the bulk insert operation assumes the data file is unordered. For optimized bulk import, SQL Server also validates that the imported data is sorted.
https://docs.microsoft.com/en-us/sql/connect/ado-net/sql/bulk-copy-order-hints?view=sql-server-ver15
Reference Implementation