rdblue commented on code in PR #7569:
URL: https://github.com/apache/iceberg/pull/7569#discussion_r1199833320


##########
core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java:
##########
@@ -1742,4 +1753,129 @@ public void 
testCatalogTokenRefreshDisabledWithCredential() {
             eq(catalogHeaders),
             any());
   }
+
+  @Test
+  public void multipleDiffsAgainstSingleTable() {
+    Namespace namespace = Namespace.of("namespace");
+    TableIdentifier identifier = TableIdentifier.of(namespace, 
"multipleDiffsAgainstSingleTable");
+
+    Transaction transaction = catalog().buildTable(identifier, 
SCHEMA).create().newTransaction();
+
+    UpdateSchema updateSchema =
+        transaction.updateSchema().addColumn("new_col", Types.LongType.get());
+    Schema expectedSchema = updateSchema.apply();
+    updateSchema.commit();
+
+    UpdatePartitionSpec updateSpec =
+        transaction.updateSpec().addField("shard", Expressions.bucket("id", 
16));
+    PartitionSpec expectedSpec = updateSpec.apply();
+    updateSpec.commit();
+
+    TableCommit tableCommit =
+        ImmutableTableCommit.builder()
+            .identifier(identifier)
+            .base(((BaseTransaction) transaction).startMetadata())
+            .changes(((BaseTransaction) 
transaction).currentMetadata().changes())
+            .build();
+
+    restCatalog.commitTransaction(ImmutableList.of(tableCommit));
+
+    Table loaded = catalog().loadTable(identifier);
+    
assertThat(loaded.schema().asStruct()).isEqualTo(expectedSchema.asStruct());
+    assertThat(loaded.spec().fields()).isEqualTo(expectedSpec.fields());
+  }
+
+  @Test
+  public void multipleDiffsAgainstMultipleTables() {
+    Namespace namespace = Namespace.of("multiDiffNamespace");
+    TableIdentifier identifier1 = TableIdentifier.of(namespace, 
"multiDiffTable1");
+    TableIdentifier identifier2 = TableIdentifier.of(namespace, 
"multiDiffTable2");
+
+    Transaction transaction1 = catalog().buildTable(identifier1, 
SCHEMA).create().newTransaction();
+    Transaction transaction2 = catalog().buildTable(identifier2, 
SCHEMA).create().newTransaction();

Review Comment:
   The pattern of creating tables and starting transactions at the same time 
comes up here, where it isn't clear further on whether the transactions are for 
the same table or different tables.
   
   It would help to name these `t1transaction` and `t2transaction` to make that 
clear. And separating the create code for `t1` and `t2` would also help.



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