You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "vox-vox-vox (via GitHub)" <gi...@apache.org> on 2025/05/21 07:21:23 UTC
[I] REST Catalog: Attempting to load a table with a reserved name (e.g., snapshots) before creation causes an error [iceberg]
vox-vox-vox opened a new issue, #13115:
URL: https://github.com/apache/iceberg/issues/13115
### Apache Iceberg version
1.9.0 (latest release)
### Query engine
Spark
### Please describe the bug 🐞
# Description
When using the Spark engine with the REST Catalog, attempting to load a table that has a reserved name (e.g., metadata, snapshots, etc.) before creating it triggers an unexpected error. This behavior check for table existence before creation.
# Steps to Reproduce
just past this code in org.apache.iceberg.rest.TestRESTCatalog
```java
@Test
public void reproduceError(){
RESTCatalog catalog = catalog();
catalog.createNamespace(Namespace.of("newdb"));
TableIdentifier identifier = TableIdentifier.of("newdb", "snapshots");
if(catalog.tableExists(identifier)){
catalog.buildTable(identifier, SCHEMA).create();
}
catalog.loadTable(identifier);
}
```
# Expected Behavior
Loading a non-existent table should return false if the table does not exist.
Creating a table with a reserved name should success
# Actual Behavior
throw errors in `TableIdentifier identifier = TableIdentifier.of("newdb", "snapshots");`
### Willingness to contribute
- [x] I can contribute a fix for this bug independently
- [x] I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- [ ] I cannot contribute a fix for this bug at this time
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] REST Catalog: Attempting to load a table with a reserved name (e.g., snapshots) before creation causes an error [iceberg]
Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on issue #13115:
URL: https://github.com/apache/iceberg/issues/13115#issuecomment-2935085503
A similar issue has been reported for Polaris so I'm investigating this:
https://github.com/apache/polaris/issues/1771
Here are my findings so far:
* ✅ `catalog.loadTable("snapshots")` throws `NoSuchTableException` (expected) with message: `Invalid table identifier: snapshots`
* ⛔ `catalog.loadTable("ns1", "snapshots")` throws unexpected errors:
* In Iceberg tests: throws `BadRequestException` with message: `Malformed request: <h1>Bad Message 400</h1><pre>reason: Ambiguous URI empty segment</pre>`
* thrown by the Jetty server used in tests
* translates to HTTP 400 hence `BadRequestException`
* In Polaris: throws a Jax-RS `NotFoundException`
* thrown by Resteasy `ClassRoutingHandler`
* translates to HTTP 404 hence decoded as `NoSuchTableException`, but with a weird message: `Unable to find matching target resource method`
* due to empty namespace when attempting to load table `ns1` so `paths.table(identifier)` yields `v1/quickstart_catalog/namespaces//tables/test`
* fix is easy, should go in `RESTSessionCatalog#loadTable`
* ⚠️ `catalog.loadTable("ns1", "ns2", "snapshots")` throws `NoSuchTableException` (expected) but with wrong table name: `ns1.ns2`
* due to this line (should be `identifier` instead of `baseIdentifier`):
https://github.com/apache/iceberg/blob/a3dcfd19fd1b2a709f7bdf013b83836953d49c6f/core/src/main/java/org/apache/iceberg/BaseMetastoreCatalog.java#L106
@nastra @vox-vox-vox do you agree with the above findings?
If so I can provide a fix quickly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] REST Catalog: Attempting to load a table with a reserved name (e.g., snapshots) before creation causes an error [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #13115:
URL: https://github.com/apache/iceberg/issues/13115#issuecomment-3594007058
This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] REST Catalog: Attempting to load a table with a reserved name (e.g., snapshots) before creation causes an error [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #13115:
URL: https://github.com/apache/iceberg/issues/13115#issuecomment-4703665122
This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] REST Catalog: Attempting to load a table with a reserved name (e.g., snapshots) before creation causes an error [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #13115:
URL: https://github.com/apache/iceberg/issues/13115#issuecomment-3658137660
This issue has been closed because it has not received any activity in the last 14 days since being marked as 'stale'
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] REST Catalog: Attempting to load a table with a reserved name (e.g., snapshots) before creation causes an error [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #13115: REST Catalog: Attempting to load a table with a reserved name (e.g., snapshots) before creation causes an error
URL: https://github.com/apache/iceberg/issues/13115
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] REST Catalog: Attempting to load a table with a reserved name (e.g., snapshots) before creation causes an error [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on issue #13115:
URL: https://github.com/apache/iceberg/issues/13115#issuecomment-2896900421
This is unfortunately a known issue that hasn't been addressed yet. See also https://github.com/apache/iceberg/issues/10550 for additional details
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org