rymurr commented on a change in pull request #2588:
URL: https://github.com/apache/iceberg/pull/2588#discussion_r670765768



##########
File path: 
nessie/src/main/java/org/apache/iceberg/nessie/UpdateableReference.java
##########
@@ -44,6 +45,15 @@ public boolean refresh() throws NessieNotFoundException {
     return !oldReference.equals(reference);
   }
 
+  public void updateReference(Reference ref) {
+    Objects.requireNonNull(ref);
+    if (this.reference.getClass() != ref.getClass()) {
+      throw new IllegalArgumentException("Expected " + 
this.reference.getClass().getName() +

Review comment:
       Typically iceberg exceptions are `Cannot do <x>. Reason. [optinally fix]`

##########
File path: nessie/src/main/java/org/apache/iceberg/nessie/NessieCatalog.java
##########
@@ -225,8 +233,13 @@ public void renameTable(TableIdentifier from, 
TableIdentifier toOriginal) {
           .throwFailureWhenFinished()
           .onFailure((c, exception) -> refresh())
           .run(c -> {
-            
client.getTreeApi().commitMultipleOperations(reference.getAsBranch().getName(), 
reference.getHash(), c);
-            refresh();
+            Branch branch = 
client.getTreeApi().commitMultipleOperations(reference.getAsBranch().getName(),
+                reference.getHash(), c);
+            if (branch != null) {

Review comment:
       When does the API return null?

##########
File path: 
nessie/src/main/java/org/apache/iceberg/nessie/UpdateableReference.java
##########
@@ -44,6 +45,15 @@ public boolean refresh() throws NessieNotFoundException {
     return !oldReference.equals(reference);
   }
 
+  public void updateReference(Reference ref) {
+    Objects.requireNonNull(ref);
+    if (this.reference.getClass() != ref.getClass()) {
+      throw new IllegalArgumentException("Expected " + 
this.reference.getClass().getName() +

Review comment:
       additionally why even do this check? 

##########
File path: 
nessie/src/test/java/org/apache/iceberg/nessie/TestBranchVisibility.java
##########
@@ -79,31 +79,34 @@ public void testUpdateCatalogs() {
   }
 
   @Test
-  public void testCatalogOnReference() throws NessieNotFoundException {
+  public void testCatalogOnReference() {
     updateSchema(catalog, tableIdentifier1);
     updateSchema(testCatalog, tableIdentifier2);
-    String mainHash = tree.getReferenceByName("main").getHash();
 
     // catalog created with ref points to same catalog as above
     NessieCatalog refCatalog = initCatalog("test");
     testCatalogEquality(refCatalog, testCatalog, true, true);
 
     // catalog created with hash points to same catalog as above
-    NessieCatalog refHashCatalog = initCatalog(mainHash);
+    NessieCatalog refHashCatalog = initCatalog("main");
     testCatalogEquality(refHashCatalog, catalog, true, true);
   }
 
   @Test
-  public void testCatalogWithTableNames() throws NessieNotFoundException {
+  public void testCatalogWithTableNames() {
     updateSchema(testCatalog, tableIdentifier2);
-    String mainHash = tree.getReferenceByName("main").getHash();
+
+    String mainName = "main";
 
     // asking for table@branch gives expected regardless of catalog
     Assertions.assertThat(metadataLocation(catalog, 
TableIdentifier.of("test-ns", "table1@test")))
         .isEqualTo(metadataLocation(testCatalog, tableIdentifier1));
 
-    // asking for table@branch#hash gives expected regardless of catalog
-    Assertions.assertThat(metadataLocation(catalog, 
TableIdentifier.of("test-ns", "table1@" + mainHash)))
+    // Asking for table@branch gives expected regardless of catalog.
+    // Earlier versions used "table1@" + 
tree.getReferenceByName("main").getHash() before, but since
+    // Nessie 0.8.2 the branch name became mandatory and specifying a hash 
within a branch is not
+    // possible.
+    Assertions.assertThat(metadataLocation(catalog, 
TableIdentifier.of("test-ns", "table1@" + mainName)))

Review comment:
       Can you file an issue to fix this. We have effectively removed Nessie 
based time-travel in ths PR and it shoudl be added back. #1825 has most of the 
implementation to add it back already

##########
File path: versions.props
##########
@@ -18,13 +18,11 @@ org.apache.arrow:arrow-memory-netty = 2.0.0
 com.github.stephenc.findbugs:findbugs-annotations = 1.3.9-1
 software.amazon.awssdk:* = 2.15.7
 org.scala-lang:scala-library = 2.12.10
-org.projectnessie:* = 0.5.1
-javax.ws.rs:javax.ws.rs-api = 2.1.1
-io.quarkus:* = 1.13.1.Final
+org.projectnessie:* = 0.8.2
 
 # test deps
-org.junit.vintage:junit-vintage-engine = 5.7.2
-org.junit.jupiter:junit-jupiter = 5.7.2
+org.junit.vintage:* = 5.7.2

Review comment:
       why this change?




-- 
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]

Reply via email to