Skip to content

[Spark] Support type widening during schema evolution in the DSv2 write path#7074

Open
johanl-db wants to merge 1 commit into
delta-io:masterfrom
johanl-db:dsv2-type-widening-schema-evolution
Open

[Spark] Support type widening during schema evolution in the DSv2 write path#7074
johanl-db wants to merge 1 commit into
delta-io:masterfrom
johanl-db:dsv2-type-widening-schema-evolution

Conversation

@johanl-db

Copy link
Copy Markdown
Collaborator

Description

Support changing column data types during write operations that use the DSv2 code path. With DSv2, Spark is responsible for schema evolution (see the ResolveSchemaEvolution rule), and the connector indicates whether a given column change is supported by implementing SupportsSchemaEvolution.

Changes:

  • Implement SupportsSchemaEvolution for the Delta DSv2 table (DeltaV2Table). Type changes are accepted when type widening is enabled on the table and no condition prevents changing the column's data type: the column must not be referenced in a generated column expression or a CHECK constraint.
  • Add a temporary fallback to the v1 path for ALTER TABLE, which is not yet supported on the DSv2 path. ResolveSchemaEvolution calls into alterTable() to apply changes.

How was this patch tested?

Added DSv2 variants of the type widening suites covering schema evolution.

@johanl-db johanl-db force-pushed the dsv2-type-widening-schema-evolution branch 4 times, most recently from 457ae35 to 63ccd2d Compare June 24, 2026 11:19
@johanl-db johanl-db force-pushed the dsv2-type-widening-schema-evolution branch from 63ccd2d to b9f4362 Compare June 24, 2026 14:20
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