Skip to content

Hive: Throw exception for when listing a non-existing namespace#13130

Merged
nastra merged 2 commits into
apache:mainfrom
jmelinav:feature/hive-list-non-existing-namespace
Jun 3, 2025
Merged

Hive: Throw exception for when listing a non-existing namespace#13130
nastra merged 2 commits into
apache:mainfrom
jmelinav:feature/hive-list-non-existing-namespace

Conversation

@jmelinav
Copy link
Copy Markdown
Contributor

Throw exception for when listing a non-existing namespace

Fixes #12874

@github-actions github-actions Bot added the hive label May 22, 2025
@pvary
Copy link
Copy Markdown
Contributor

pvary commented May 23, 2025

@jmelinav: Could you please run ./gradlew spotlessApply and ./gradlew checkstyleMain?

Comment thread hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveCatalog.java Outdated
@Override
public List<Namespace> listNamespaces(Namespace namespace) {
if (!isValidateNamespace(namespace) && !namespace.isEmpty()) {
if (!namespace.isEmpty() && (!isValidateNamespace(namespace) || !namespaceExists(namespace))) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: move line 514-516 to the beginning of this method. then we can remove the namespace condition here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the issue is with non existing namespace, if I move the lines 514-516 to the beginning, it will always return empty list irrespective of whether namespace exists or not. (which is the current behavior).

@stevenzwu stevenzwu added this to the Iceberg 1.10.0 milestone Jun 2, 2025
@nastra nastra merged commit e5b97d3 into apache:main Jun 3, 2025
42 checks passed
@pvary
Copy link
Copy Markdown
Contributor

pvary commented Jun 3, 2025

Thanks @jmelinav for the PR, and sorry for the long delay in merging!

devendra-nr pushed a commit to devendra-nr/iceberg that referenced this pull request Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hive should throw a NoSuchNamespaceException when listing a non-existing namespace

5 participants