Skip to content

Fabric Warehouse: support the staging-optimized replace strategy #4144

Description

@sdebruyn

Feature description

Enable the staging-optimized replace strategy for the fabric destination, backed by DDL transactions and ALTER SCHEMA ... TRANSFER.

Use case

The fabric destination inherits its capabilities from synapse, which has supports_ddl_transactions = False and does not offer staging-optimized (Synapse dedicated SQL pools support neither). Microsoft Fabric Warehouse does support DDL transactions and ALTER SCHEMA ... TRANSFER.

For a full-table replace, that makes the operation a metadata-only schema swap instead of a truncate-and-insert or insert-from-staging copy. That is what staging-optimized is for, and it is much faster on large tables. Today Fabric users cannot select it.

The Fabric docs already describe staging-optimized as using ALTER SCHEMA ... TRANSFER and state that Fabric supports DDL transactions, so the current behavior also contradicts the documentation.

Proposed solution

Have the fabric destination advertise and implement staging-optimized. Two parts are needed; flipping the capability flags alone is not enough:

  1. advertise supports_ddl_transactions = True and add staging-optimized to supported_replace_strategies;
  2. override _create_replace_followup_jobs on the Fabric client. SynapseClient deliberately bypasses the mssql ALTER SCHEMA ... TRANSFER replace job and always falls back to the generic truncate-and-insert job. Without the override, staging-optimized would be advertised but silently behave like insert-from-staging.

Related issues

N/A

Metadata

Metadata

Assignees

Labels

FeaturedestinationIssue with a specific destinationneeds decisionActionable; needs maintainer decision on whether to implement.

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions