-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Multipart namespaces support (Nessie and Rest catalogs) #23453
base: master
Are you sure you want to change the base?
Conversation
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
…estTrinoNessieCatalog & TestTrinoRestCatalog
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution.
firstLevel + dotSeparator + secondLevel + dotSeparator + thirdLevel); | ||
|
||
for (String namespace : namespacesList) { | ||
catalog.createNamespace(SESSION, namespace, ImmutableMap.of(), new TrinoPrincipal(PrincipalType.USER, SESSION.getUser())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use stram apis where applicable. namespacesList.forEach(..)
@Test | ||
public void testMultipartNamespace() | ||
{ | ||
String dotSeparator = "."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we inherently assume that .
(dot) in the name represents a nested namespace. ie if user creates ns1.ns2.ns3 namespace then it will be created in a nested fashion. Do we want to support a ns with .
in the name without creating a nested namespace meaning ns1.n2.ns3 will created at first level.
return restSessionCatalog.listNamespaces(convert(session)).stream() | ||
.map(Namespace::toString) | ||
.collect(toImmutableList()); | ||
return collectNamespaces(session, Namespace.empty()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please add similar changes for other object management methods like create/drop/rename a table/view/mvs etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Add multipart namespace support to TrinoRestCatalog (with test) -> Add multipart namespace support to TrinoRestCatalog
you may want to keep only two commits one for rest and another for nessie and squash the commits.
} | ||
|
||
@Override | ||
public void dropNamespace(ConnectorSession session, String namespace) | ||
{ | ||
try { | ||
restSessionCatalog.dropNamespace(convert(session), Namespace.of(namespace)); | ||
restSessionCatalog.dropNamespace(convert(session), toNamespace(namespace)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should list and delete all the child namespaces and then the requested namespace.
for (String namespace : namespacesList) { | ||
try { | ||
catalog.dropNamespace(SESSION, namespace); | ||
} | ||
catch (Exception e) { | ||
LOG.warn("Failed to clean up namespace: %s", namespace); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use stream api. Remove catch clause as it shouldn't be required.
Description
Add multipart namespaces support for Nessie and Rest iceberg catalogs.
Additional context and related issues
#22916
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x) Release notes are required, with the following suggested text: