-
Notifications
You must be signed in to change notification settings - Fork 29.2k
[SPARK-55690] Schema evolution in DSv2 AppendData, OverwriteByExpression, OverwritePartitionsDynamic #54488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+1,041
−322
Closed
[SPARK-55690] Schema evolution in DSv2 AppendData, OverwriteByExpression, OverwritePartitionsDynamic #54488
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b3963d0
Move ResolveMergeIntoSchemaEvolution.scala -> ResolveMergeIntoSchemaE…
johanl-db 05b32cb
Move schemaChanges from MergeIntoTable to ResolveSchemaEvolution
johanl-db 7be9d2a
Schema evolution for DSv2 INSERT
johanl-db 6bc2956
Merge branch 'master' into dsv2-schema-evolution-insert
johanl-db a3042e3
Add tests, address comments
johanl-db aeae2b4
Add tests
johanl-db 862fdb6
Fix checking catalog name in test
johanl-db 42ca213
Refactor to use single schema evolution rule + address comments
johanl-db 18f10a1
Minor improvements
johanl-db b7e303f
Merge remote-tracking branch 'spark/master' into dsv2-schema-evolutio…
johanl-db 0cc771f
Resolve conflicts from https://github.com/apache/spark/pull/54704
johanl-db 65ba49a
Address comments
johanl-db ac8fca6
Merge remote-tracking branch 'spark/master' into dsv2-schema-evolutio…
johanl-db 56ea329
Fix val->def writePrivileges override
johanl-db d777acc
Update tests, remove mergeSchema in REPLACE WHERE
johanl-db f8374b6
Address nits
johanl-db File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
98 changes: 0 additions & 98 deletions
98
...c/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveMergeIntoSchemaEvolution.scala
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johanl-db @szehon-ho, can you folks explain the relation between skipSchemaEvolution via ACCEPT_ANY_SCHEMA and automatic schema evolution via AUTOMATIC_SCHEMA_EVOLUTION? Are these two mutually exclusive? Or can they co-exist? MERGE vs INSERT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge with ACCEPT_ANY_SCHEMA on normal DSV2 data source breaks today as it relies on external rule to resolve the merge.
I think insert already works with ACCEPT_ANY_SCHEMA, and this would be another mode. Probably should be mutually exclusive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed with @aokolnychyi this morning:
AUTOMATIC_SCHEMA_EVOLUTIONandACCEPT_ANY_SCHEMAare not exclusive:AUTOMATIC_SCHEMA_EVOLUTIONallows the rule ResolveSchemaEvolution to triggerACCEPT_ANY_SCHEMAskips some resolution steps in Spark, under the assumption that the connector will handle them. In particular:At least, that's how Spark applies these capabilities today, even though the name
ACCEPT_ANY_SCHEMAsuggests more.The connector can choose to set either depending on the resolution flow that suits.
For example, Delta today always handles schema evolution itself (doesn't set
AUTOMATIC_SCHEMA_EVOLUTION) and does resolution / schema alignment (setsACCEPT_ANY_SCHEMA)As Delta moves to DSv2, my plan is to have two phases:
AUTOMATIC_SCHEMA_EVOLUTIONandACCEPT_ANY_SCHEMA: Spark handles schema evolution, but Delta takes over to do the resolution of MERGE clauses initially, and then do schema alignment for both INSERT and MERGEAUTOMATIC_SCHEMA_EVOLUTION: once we've reconciled all behavior differences between how Delta and Spark do schema alignment today, we hand over schema alignment to Spark. This will require substantial efforts, and careful breaking changes (if at all possible) in Delta