-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Schema evolution in merge for UPDATE/INSERT non-star actions
This change implements support for schema evolution in merge for UPDATE SET <assignments> and INSERT (...) VALUES (...) actions. Before this, schema evolution was only triggered with UPDATE SET * and INSERT * actions. The following example fails on resolving `target.newColumn` before this change, with schema evolution enabled it now succeeds and adds `newColumn` to the target table schema: Target schema: `key: int, value: int` Source schema: `key: int, value: int, newColumn: int` ``` MERGE INTO target] USING source ON target.key = source.key WHEN MATCHED THEN UPDATE SET target.newColumn = source.newColumn ``` Changes: - When schema evolution is enabled, allow resolving assignments in merge actions against the source table when resolving against the target table fails. - When schema evolution is enabled, collect all new columns and nested fields in the source table that are assigned to by any merge action and add them to the table schema, taking into account * actions. Extensive tests added to MergeIntoSuiteBase covering schema evolution for both top level columns and nested attributes. GitOrigin-RevId: 3387f19fd987d769fdc719255bbdbcaf92db6bba
- Loading branch information
1 parent
8a70d11
commit affd577
Showing
3 changed files
with
306 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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 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 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