-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
REST Catalog does not validate "to" identifier on rename table #11154
Comments
I analyzed this and Stripping the catalog name was added to Hive with #1156, but what I think we need to investigate here is why this issue only happens in testing and not when running through the Spark quickstart example, which also uses the REST catalog. |
Most likely it's related to whether you provide catalog name to rename statement or not. Here's what I did:
Explanation: |
Query engine
Spark
Question
Background
Spark will pass
catalog
name torenameTable
operations as part of itsto
identifier, and if thatcatalog
name is not handled (i.e. stripped), then it will be treated as part of thenamespace
name. This will cause spark to rename the table into undesirable namespaces (or even just encounter namespace not exist issue and fail).Traditional catalog like HiveCatalog has special pre-validation in renameTable operation for this purpose (ref: #1156), while RESTCatalog and JdbcCatalog (ref REST server implementation is adapter on JdbcCatalog) does not have it. This is causing spark command like
ALTER TABLE ${tbl} RENAME TO ${tbl_rename}
to fail on RESTCatalog/JdbcCatalog such as in this integration test: https://github.com/apache/iceberg/blob/316f0a1/spark/v3.3/spark/src/test/java/org/apache/iceberg/spark/sql/TestAlterTable.java#L296Part of #11079
Questions
to
identifier inrenameTable
operation just like what HiveCatalog is doing?to
identifier, then what if the intention is to rename to a legitimate multi-level namespace?The text was updated successfully, but these errors were encountered: