ajantha-bhat commented on code in PR #8909:
URL: https://github.com/apache/iceberg/pull/8909#discussion_r1375927666
##########
nessie/src/main/java/org/apache/iceberg/nessie/NessieCatalog.java:
##########
@@ -347,4 +348,54 @@ private TableIdentifier identifierWithoutTableReference(
protected Map<String, String> properties() {
return catalogOptions;
}
+
+ @Override
+ protected ViewOperations newViewOps(TableIdentifier identifier) {
+ TableReference tr = parseTableReference(identifier);
+ return new NessieViewOperations(
+ ContentKey.of(
+
org.projectnessie.model.Namespace.of(identifier.namespace().levels()),
tr.getName()),
+ client.withReference(tr.getReference(), tr.getHash()),
+ fileIO,
+ catalogOptions);
+ }
+
+ @Override
+ public List<TableIdentifier> listViews(Namespace namespace) {
+ return client.listViews(namespace);
+ }
+
+ @Override
+ public boolean dropView(TableIdentifier identifier) {
+ TableReference tableReference = parseTableReference(identifier);
+ return client
+ .withReference(tableReference.getReference(), tableReference.getHash())
+ .dropView(identifierWithoutTableReference(identifier, tableReference),
false);
+ }
+
+ @Override
+ public void renameView(TableIdentifier from, TableIdentifier to) {
+ TableReference fromTableReference = parseTableReference(from);
+ TableReference toTableReference = parseTableReference(to);
+ String fromReference =
+ fromTableReference.hasReference()
+ ? fromTableReference.getReference()
+ : client.getRef().getName();
+ String toReference =
+ toTableReference.hasReference()
+ ? toTableReference.getReference()
+ : client.getRef().getName();
+ Preconditions.checkArgument(
+ fromReference.equalsIgnoreCase(toReference),
+ "from: %s and to: %s reference name must be same",
+ fromReference,
+ toReference);
+
+ client
+ .withReference(fromTableReference.getReference(),
fromTableReference.getHash())
+ .renameView(
+ identifierWithoutTableReference(from, fromTableReference),
+ NessieUtil.removeCatalogName(
Review Comment:
> NessieUtil.removeCatalogName exists since the beginning of the Nessie
module:
True. I checked the usage of `from`, it is used to prepare key for Nessie
commit. So, it should not have catalog name. I will just update the code to
unify it.
--
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]