Spark 4.2: Implement SupportsSchemaEvolution for automatic schema evolution - #17957
Open
rahulsmahadev wants to merge 1 commit into
Open
Spark 4.2: Implement SupportsSchemaEvolution for automatic schema evolution#17957rahulsmahadev wants to merge 1 commit into
rahulsmahadev wants to merge 1 commit into
Conversation
…lution Implement Spark 4.2's SupportsSchemaEvolution mix-in on SparkTable so Iceberg participates in DSv2 automatic schema evolution during writes. supportsColumnChange reports support consistent with what Iceberg's schema update applies: nullable, no-default column additions of a convertible type; primitive type promotions allowed by Iceberg; relaxing nullability; column deletes except identifier fields and any field whose subtree contains one; and rename, comment, and position changes. Adds a TestSparkTable unit test.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements Spark 4.2's
SupportsSchemaEvolutionmix-in on Iceberg'sSparkTable, so Iceberg participates in DSv2 automatic schema evolution during writes.During automatic schema evolution Spark passes each candidate column change to
supportsColumnChange(TableChange.ColumnChange)and skips the ones the source reports as unsupported.SparkTablenow reports support consistent with what Iceberg's schema update actually applies:SchemaUpdate), and for unknown fields;SparkTablealready advertisesTableCapability.AUTOMATIC_SCHEMA_EVOLUTION(gated by thewrite.spark.auto-schema-evolution.enabledtable property), which is what makes Spark consult this hook. A unit test is added inTestSparkTable.