-
Notifications
You must be signed in to change notification settings - Fork 85
Misleading "namespace doesn't exist" error when in fact catalog doesn't exist #227
Copy link
Copy link
Open
Description
CREATE TABLE test (a int) USING iceberg WITH (catalog = 'rest');
ERROR: HTTP request failed (HTTP 404)
DETAIL: Namespace does not exist:
HINT: The rest catalog returned error type: NoSuchNamespaceException
After debugging, we realized with @sfc-gh-abozkurt that the namespace URL actually showed us that it was using a non-existent catalog name: https://.../polaris/api/catalog/v1/non_existing_catalog_name/namespace_name. This was a mistake from my part, as I had used a different name for the REST catalog.
The error, however, is quite misleading. When the GET for the namespace returns 404, the code assumes "namespace doesn't exist" and tries to create it. But if the catalog doesn't exist, Polaris also returns 404, and the subsequent CreateNamespaceOnRestCatalog call also fails with a 404 "Namespace does not exist" which is misleading. See function RegisterNamespaceToRestCatalog. We should check whether the catalog exists first.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels