bharos commented on code in PR #15840:
URL: https://github.com/apache/iceberg/pull/15840#discussion_r3034149294


##########
spark/v4.0/spark/src/test/java/org/apache/iceberg/spark/source/TestSparkTable.java:
##########
@@ -56,4 +58,60 @@ public void testTableEquality() throws NoSuchTableException {
     assertThat(table1).as("References must be different").isNotSameAs(table2);
     assertThat(table1).as("Tables must be equivalent").isEqualTo(table2);
   }
+
+  @TestTemplate
+  public void testTableInequalityWithDifferentSnapshots() throws 
NoSuchTableException {
+    sql("INSERT INTO %s VALUES (1, 'a')", tableName);
+    sql("INSERT INTO %s VALUES (2, 'b')", tableName);
+
+    CatalogManager catalogManager = spark.sessionState().catalogManager();
+    TableCatalog catalog = (TableCatalog) catalogManager.catalog(catalogName);
+    Identifier identifier = Identifier.of(tableIdent.namespace().levels(), 
tableIdent.name());
+    SparkTable table = (SparkTable) catalog.loadTable(identifier);
+
+    if (catalog instanceof SparkCatalog) {

Review Comment:
   Switched to `validationCatalog.loadTable(tableIdent)` with a 
`table.table().refresh()` after branch creation to pick up the latest metadata.



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