atc-net / atc-dataplatform

A common set of python libraries for DataBricks
https://atc-net.github.io/repository/atc-dataplatform
MIT License
8 stars 3 forks source link

Feature/tab lock write sql #228

Closed LauJohansson closed 1 year ago

LauJohansson commented 1 year ago

To improve the write opreration to SQL server the SqlServer class should use TabLock.

tableLock= TRUE Implements an insert with TABLOCK option to improve write performance https://learn.microsoft.com/en-us/sql/connect/spark/connector?view=sql-server-ver16#supported-options

Microsoft has also done performance comparisons of the mssql connector using TABLOCK. See: https://github.com/microsoft/sql-spark-connector/blob/master/README.md#performance-comparison

See also: https://learn.microsoft.com/en-us/sql/connect/jdbc/using-bulk-copy-with-the-jdbc-driver?view=sql-server-ver16