Azure SQL
The Azure SQL destination writes data to a table in Azure SQL Database, Azure Synapse SQL Pool, or Microsoft SQL Server version 2008 or later.
The destination can create tables as needed. It can also perform a bulk copy when writing to a table.
When you configure the Azure SQL destination, you specify the database URL, database name, and credentials. You can also define any additional JDBC configuration properties that you want to use.
You specify the table to write to and whether to perform a bulk copy. When performing a bulk copy, you define related properties including the batch size, timeout, and reliability and isolation levels. You can optionally configure additional bulk copy properties.
When not performing a bulk copy, you specify the write mode for writing to the table.
Transformer includes a Microsoft JDBC driver for SQL Server with the destination. The destination uses Microsoft JDBC driver for SQL Server version 8 or later.
Partitioning
Spark runs a Transformer pipeline just as it runs any other application, splitting the data into partitions and performing operations on the partitions in parallel.
When the pipeline starts processing a new batch, Spark determines how to split pipeline data into initial partitions based on the origins in the pipeline. Spark uses these partitions for the rest of the pipeline processing, unless a processor causes Spark to shuffle the data.
When writing to a database table, Spark creates one connection to the database for each partition.
Write Mode
The Azure SQL destination uses the write mode to determine how to write to a table. You can configure a write mode when the destination is not configured to perform a bulk copy.
When the Azure SQL destination is configured to write to a table that doesn't exist, the destination creates the table in the specified database. The table is created based on the first batch of data that the destination processes when you start the pipeline, and that first batch is inserted to the new table.
The write mode defines how the destination writes to an existing table, including the second batch to a table that the destination created.
- Append to table
- The destination appends rows to the table.
- Overwrite table
- The destination removes all rows in the table before writing new rows to the
table. When you select overwrite mode, you also configure how the
destination removes rows from the table:
- Truncates all rows in the table before the write
- Drops and recreates the table before the write.