-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Core: Assign fresh IDs to view schema #10253
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1798,8 +1798,9 @@ public void createOrReplaceViewKeepsViewHistory() { | |
assertThat(view.schema().asStruct()) | ||
.isEqualTo( | ||
new Schema( | ||
Types.NestedField.optional(0, "new_id", Types.IntegerType.get(), "some ID"), | ||
Types.NestedField.optional(1, "new_data", Types.StringType.get(), "some data")) | ||
0, | ||
Types.NestedField.optional(1, "new_id", Types.IntegerType.get(), "some ID"), | ||
Types.NestedField.optional(2, "new_data", Types.StringType.get(), "some data")) | ||
Comment on lines
+1802
to
+1803
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So the first field ID changed to 1 because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes correct, that's exactly how it is done |
||
.asStruct()); | ||
|
||
sql("CREATE OR REPLACE VIEW %s (updated_id COMMENT 'updated ID') AS %s", viewName, updatedSql); | ||
|
@@ -1813,8 +1814,9 @@ public void createOrReplaceViewKeepsViewHistory() { | |
assertThat(view.schema().asStruct()) | ||
.isEqualTo( | ||
new Schema( | ||
1, | ||
Types.NestedField.optional( | ||
0, "updated_id", Types.IntegerType.get(), "updated ID")) | ||
3, "updated_id", Types.IntegerType.get(), "updated ID")) | ||
.asStruct()); | ||
} | ||
|
||
|
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.
changing this to show that the new column get's a re-assigned column ID