Nessie: Fix drop/rename table with TableReference in identifier#5033
Merged
pvary merged 2 commits intoapache:masterfrom Jun 23, 2022
Merged
Nessie: Fix drop/rename table with TableReference in identifier#5033pvary merged 2 commits intoapache:masterfrom
pvary merged 2 commits intoapache:masterfrom
Conversation
Member
Author
nastra
approved these changes
Jun 14, 2022
| tableIdentifier = identifier; | ||
| } | ||
|
|
||
| NessieIcebergClient newClient = this.client.withReference(tableReference.getReference(), tableReference.getHash()); |
Contributor
|
@RussellSpitzer could you merge this one please? |
pvary
reviewed
Jun 21, 2022
| @Override | ||
| public boolean dropTable(TableIdentifier identifier, boolean purge) { | ||
| return client.dropTable(identifier, purge); | ||
| TableReference tableReference = parseTableReference(identifier); |
Contributor
There was a problem hiding this comment.
Don't we have the same issue with renameTable?
Member
Author
There was a problem hiding this comment.
Good catch. I saw it during debugging. But forgot to handle.
Handled now.
pvary
approved these changes
Jun 22, 2022
Contributor
pvary
left a comment
There was a problem hiding this comment.
+1 from me
I will give this some time, so if some want to chime in, they can comment, then if there are no more comments I will merge
snazy
approved these changes
Jun 22, 2022
Contributor
|
Merged to master. |
Member
Author
|
@pvary : Thanks for the merge and review. |
namrathamyske
pushed a commit
to namrathamyske/iceberg
that referenced
this pull request
Jul 10, 2022
namrathamyske
pushed a commit
to namrathamyske/iceberg
that referenced
this pull request
Jul 10, 2022
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.
From
NessieCatalog(initialized to"main"branch),load table works with
TableReference(aka`tableName@branch`syntax),catalog.loadTable(TableIdentifier.parse("db1.`table1.@branch1`")) -- works
but drop table will NOT work with
TableReference,catalog.dropTable(TableIdentifier.parse("db1.`table1.@branch1`")) -- return false.
Reason: For drop table, key used to look up Nessie backend will have table reference which is not an actual key in Nessie backend.
Fix: From
TableIdentifierwithTableReference, need to extract valid identifier to be used as a key for the drop table.Note: Without this PR, the workaround is to re-Initialize (or create new) catalog with a specific branch and call drop table without a table reference.
Similar issue with renameTable() method also