Skip to content

feat: add hms list namespaces#135

Merged
jackye1995 merged 3 commits into
lance-format:mainfrom
wojiaodoubao:hms-list-namespace
Jul 18, 2025
Merged

feat: add hms list namespaces#135
jackye1995 merged 3 commits into
lance-format:mainfrom
wojiaodoubao:hms-list-namespace

Conversation

@wojiaodoubao

@wojiaodoubao wojiaodoubao commented Jul 16, 2025

Copy link
Copy Markdown
Collaborator

Closes #102

@github-actions github-actions Bot added enhancement New feature or request java Java features labels Jul 16, 2025
}

@Test
public void testListNamespacesV3() throws Exception {

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.

wdyt about adding a test for an empty database?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think "hive.mydb" and "mycatalog.default" should cover empty databases. Please correct me if I miss anything.

} else {
throw new RuntimeException(String.format("Namespace parent {} is too long.", parent));
}
} catch (TException e) {

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.

what about metaexception

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Since MetaException is derived from TException, it will be caught and wrapped with RuntimeException then throw. Do you mean we shouldn't wrap MetaException with a RuntimeException?


public class CoreKeys {
public static final String CATALOG_IMPL = "lance.namespace.catalog-impl";
public static final String CATALOG_IMPL_DEFAULT =

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: NS_IMPL_DEFAULT

Comment thread java/pom.xml Outdated
assertEquals(Sets.newHashSet(), namespace.listNamespaces(request).getNamespaces());

// Case 5: non-existing catalog, database, table.
request.setParent(Lists.list("nonexistedcatalog"));

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.

HiveMetastore client returns an empty list if the catalog doesn't exist, and that's why we get an empty response for non existent catalogs.

Related to the spec, I see that the ListNamespace operation doesn’t define a not found exception for listing with parent. Is this intentional @jackye1995

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

that seems like a miss, but maybe we can add that in a separated PR.

@jackye1995 jackye1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

thanks for the work @wojiaodoubao! There are some minor comments but I think we can address in later PRs along the way, let's go! And thanks @geruh for the review!

@jackye1995 jackye1995 merged commit 9f1f23b into lance-format:main Jul 18, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request java Java features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Java HiveNamespace ListNamespaces

3 participants