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



##########
File path: nessie/src/test/java/org/apache/iceberg/nessie/TestBranchHash.java
##########
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.nessie;
+
+import com.dremio.nessie.client.NessieClient;
+import com.dremio.nessie.error.NessieConflictException;
+import com.dremio.nessie.error.NessieNotFoundException;
+import org.apache.iceberg.Table;
+import org.apache.iceberg.catalog.TableIdentifier;
+import org.apache.iceberg.types.Types;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestBranchHash extends BaseTestIceberg {
+
+  private static final String BRANCH = "test-branch-hash";
+
+  public TestBranchHash() {
+    super(BRANCH);
+  }
+
+  @Test
+  public void testBasicBranch() throws NessieNotFoundException, 
NessieConflictException {
+    TableIdentifier foobar = TableIdentifier.of("foo", "bar");
+
+    Table bar = createTable(foobar, 1); // table 1
+    catalog.refresh();

Review comment:
       References aren't refreshed on commits. So while the ref is shared its 
out of date everywhere.
   
   This normally isn't a problem but since in this test we are creating a 
branch off the current state of the 'test-branch-hash' branch we explicitly 
need the up to date hash. Note: in the `TableOperations` the metadata would be 
up to date so querying the data would work fine. In normal practice the ref 
being out of date will only mean we don't get any updates from other users (not 
the recommended usage pattern) or we would get a merge conflict if we updated 
the table after someone else has.




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

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