nastra commented on a change in pull request #4330:
URL: https://github.com/apache/iceberg/pull/4330#discussion_r827810638



##########
File path: nessie/src/test/java/org/apache/iceberg/nessie/BaseTestIceberg.java
##########
@@ -117,17 +117,21 @@ public void beforeEach(@NessieUri URI nessieUri) throws 
IOException {
     }
 
     hadoopConfig = new Configuration();
-    catalog = initCatalog(branch);
+    catalog = initCatalog(branch, null);
   }
 
-  NessieCatalog initCatalog(String ref) {
+  NessieCatalog initCatalog(String ref, String hash) {

Review comment:
       maybe just add another `initCatalog` method that accepts a `hash` 
parameter, so that all the places in the tests don't have to pass `null` all 
the time

##########
File path: nessie/src/main/java/org/apache/iceberg/nessie/NessieCatalog.java
##########
@@ -355,6 +357,10 @@ public String currentHash() {
     return reference.getHash();
   }
 
+  public String initialHash() {

Review comment:
       does this really have to be public? This should rather have a 
`@VisibleForTesting` annotation and remove the `public`

##########
File path: nessie/src/main/java/org/apache/iceberg/nessie/NessieCatalog.java
##########
@@ -379,14 +385,19 @@ private UpdateableReference loadReference(String 
requestedRef, String hash) {
     try {
       Reference ref = requestedRef == null ? api.getDefaultBranch()
           : api.getReference().refName(requestedRef).get();
-      if (hash != null) {
-        if (ref instanceof Branch) {
-          ref = Branch.of(ref.getName(), hash);
-        } else {
-          ref = Tag.of(ref.getName(), hash);
-        }
+      String hashOnRef;

Review comment:
       not sure these changes are even needed. wouldn't the code behave the 
same way without doing any changes and just passing `initialHash` to the method?




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