-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE REQUEST]Add order Hints for Bulk Copy operations #1481
Comments
Hi @luxu1-ms , |
Hi, any update on this issue |
hi @luxu1-ms Thanks. |
Any updates on this? |
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
The text was updated successfully, but these errors were encountered: