thswlsqls opened a new issue, #17058:
URL: https://github.com/apache/iceberg/issues/17058
**Apache Iceberg version**
main @ 035fc1e40
**Query engine**
N/A — catalog-level bug, engine-agnostic
**Please describe the bug**
`BigQueryMetastoreCatalog#listNamespaces(Namespace)` always throws
`NoSuchNamespaceException` for any non-empty namespace argument, even when the
namespace exists
(bigquery/src/main/java/org/apache/iceberg/gcp/bigquery/BigQueryMetastoreCatalog.java
line 233-238, prior to fix).
This contradicts the method's own Javadoc: "Since this catalog only supports
one-level namespaces, it always returns an empty list unless passed an empty
namespace to list all namespaces within the catalog."
`HiveCatalog#listNamespaces(Namespace)`
(hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java line
530-537) implements the correct pattern: check `namespaceExists(namespace)`
first, return `ImmutableList.of()` if it exists, throw only if it does not.
**Steps to reproduce**
1. `catalog.createNamespace(Namespace.of("existing_ns"))`
2. `catalog.listNamespaces(Namespace.of("existing_ns"))`
Expected: empty list. Actual: `NoSuchNamespaceException`.
**Additional context**
N/A — covered above.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]