Repository navigation
Point to the original name when moving a column renamed in the same update - #4103
Open
David-Banquet wants to merge 1 commit into
Open
David-Banquet wants to merge 1 commit into
David-Banquet wants to merge 1 commit into
Conversation
…pdate Moves resolve names against the base schema, as in Java, so moving a column by its pending new name fails. Name the original column in the error and document it.
This branch has not been deployed
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.
Closes #2599
Rationale for this change
Inside one
update_schema(),move_first,move_beforeandmove_afterlook names up in the schema as it was when the update started, plus columns added in the same update. A column renamed in the same update has to be moved by its original name. The JavaSchemaUpdate.findForMovedoes the same, so this PR keeps the behavior.What #2599 ran into is the error message:
Cannot move missing column: renamed_columnreads as if the rename was lost, which led to suspecting Glue consistency. As shown in the issue, it fails every time, on the SQL catalog as well as Glue.When the missing name matches a pending rename, the error now says so:
The same applies to the reference column of
move_beforeandmove_after. Other missing names keep the current message. The rename section of the API docs gets one sentence about it.Are these changes tested?
Yes.
test_move_renamed_column_by_new_name_points_to_original_namecovers the three move methods, an unknown name (message unchanged), and moving by the original name after the rename. It fails without the change. The schema update tests intests/test_schema.pyandtests/table/test_init.pypass.Are there any user-facing changes?
Only the error message, and the docs sentence.