nastra commented on a change in pull request #4385:
URL: https://github.com/apache/iceberg/pull/4385#discussion_r834116312
##########
File path: nessie/src/main/java/org/apache/iceberg/nessie/NessieCatalog.java
##########
@@ -281,46 +287,74 @@ public void renameTable(TableIdentifier from,
TableIdentifier toOriginal) {
// behavior. So better be safe than sorry.
}
- /**
- * creating namespaces in nessie is implicit, therefore this is a no-op.
Metadata is ignored.
- *
- * @param namespace a multi-part namespace
- * @param metadata a string Map of properties for the given namespace
- */
@Override
public void createNamespace(Namespace namespace, Map<String, String>
metadata) {
+ try {
+ api.createNamespace()
+ .refName(reference.getName())
+ .namespace(org.projectnessie.model.Namespace.of(namespace.levels()))
+ .create();
+ } catch (NessieNamespaceAlreadyExistsException e) {
+ throw new AlreadyExistsException(e, "Namespace '%s' already exists.",
namespace);
+ } catch (NessieReferenceNotFoundException e) {
+ LOG.error("Cannot create Namespace '{}': ref is no longer valid.",
namespace, e);
Review comment:
done
##########
File path: nessie/src/main/java/org/apache/iceberg/nessie/NessieCatalog.java
##########
@@ -281,46 +287,74 @@ public void renameTable(TableIdentifier from,
TableIdentifier toOriginal) {
// behavior. So better be safe than sorry.
}
- /**
- * creating namespaces in nessie is implicit, therefore this is a no-op.
Metadata is ignored.
- *
- * @param namespace a multi-part namespace
- * @param metadata a string Map of properties for the given namespace
- */
@Override
public void createNamespace(Namespace namespace, Map<String, String>
metadata) {
+ try {
+ api.createNamespace()
+ .refName(reference.getName())
Review comment:
done
##########
File path: nessie/src/main/java/org/apache/iceberg/nessie/NessieCatalog.java
##########
@@ -281,46 +287,74 @@ public void renameTable(TableIdentifier from,
TableIdentifier toOriginal) {
// behavior. So better be safe than sorry.
}
- /**
- * creating namespaces in nessie is implicit, therefore this is a no-op.
Metadata is ignored.
- *
- * @param namespace a multi-part namespace
- * @param metadata a string Map of properties for the given namespace
- */
@Override
public void createNamespace(Namespace namespace, Map<String, String>
metadata) {
+ try {
Review comment:
done
--
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]