Skip to content

[Spark] Validate against only existing commit config in UniForm enforcement on v1 saveAsTable overwrite - #7538

Open
amogh-jahagirdar wants to merge 1 commit into
delta-io:masterfrom
amogh-jahagirdar:amogh-jahagirdar/fix-dv-disabled-uniform-v1-overwrite
Open

[Spark] Validate against only existing commit config in UniForm enforcement on v1 saveAsTable overwrite#7538
amogh-jahagirdar wants to merge 1 commit into
delta-io:masterfrom
amogh-jahagirdar:amogh-jahagirdar/fix-dv-disabled-uniform-v1-overwrite

Conversation

@amogh-jahagirdar

@amogh-jahagirdar amogh-jahagirdar commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Which Delta project/connector is this regarding?

  • Spark
  • Standalone
  • Flink
  • Kernel
  • Other (fill in here)

Description

A v1 saveAsTable overwrite on a UniForm (IcebergCompat) table can fail with
DELETION_VECTORS_SHOULD_BE_DISABLED even when deletion vectors are already disabled on the table.

The UniForm dependency check in CreateDeltaTableCommand validates deltaWriter.configuration.
Currently, we validate against snapshot.metadata.configuration ++ deltaWriter.configuration after #7187 but this was to remain compatible with the previous check which just did deltaWriter.configuration. Including deltaWRiter.configuration in any case is incorrect though.

For a v1 saveAsTable
overwrite that is the wrong config to check. This overwrite is data only: it skips
replaceMetadataIfNecessary, does not change table properties, and commits the snapshot's config.
deltaWriter.configuration never persists here, and it can carry session default properties the
write never set, for example spark.databricks.delta.properties.defaults.enableDeletionVectors=true.
When the table still has the deletionVectors feature in its protocol (the state after you disable
DVs and enable UniForm), the check reads deletion vectors as enabled and fails the write, even though
that value is never committed.

The fix validates the snapshot config, which is what the overwrite commits. The snapshot config
already includes Delta-log-only properties like delta.enableIcebergCompatV3, so the check still
sees the full committed config.

How was this patch tested?

New unit test in UniversalFormatMiscSuiteBase. It creates a UniForm table that still supports the
deletionVectors feature with deletion vectors disabled, sets enableDeletionVectors=true as a
session default, and runs a v1 saveAsTable overwrite. The write succeeds and leaves deletion
vectors disabled. Without the change the same test fails with DELETION_VECTORS_SHOULD_BE_DISABLED.

Does this PR introduce any user-facing changes?

No

…Table overwrite

A v1 saveAsTable overwrite is data-only: it skips replaceMetadataIfNecessary, so the
committed configuration is the snapshot's. UniForm dependency enforcement instead validated
snapshot ++ deltaWriter.configuration, which lets session-default properties the writer picks
up (e.g. delta.enableDeletionVectors=true) override the snapshot. On a UniForm table with
deletion vectors disabled but the deletionVectors feature still in the protocol, the overwrite
failed with DELETION_VECTORS_SHOULD_BE_DISABLED for a value that is never committed.

Pass the snapshot configuration -- what the overwrite actually commits -- to enforcement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant