amogh-jahagirdar commented on code in PR #4926:
URL: https://github.com/apache/iceberg/pull/4926#discussion_r938300038


##########
core/src/test/java/org/apache/iceberg/TestOverwrite.java:
##########
@@ -300,4 +300,17 @@ public void testValidatedOverwriteWithAppendSuccess() {
     Assert.assertEquals(
         "Should not create a new snapshot", baseId, 
table.currentSnapshot().snapshotId());
   }
+
+  @Test
+  public void testOverwriteToBranchUnsupported() {
+    AssertHelpers.assertThrows(
+        "Cannot commit to branch someBranch: 
org.apache.iceberg.BaseOverwriteFiles does not support branch commits",
+        UnsupportedOperationException.class,
+        () ->
+            table
+                .newOverwrite()
+                .overwriteByRowFilter(and(equal("date", "2018-06-09"), 
lessThan("id", 20)))
+                .addFile(FILE_10_TO_14)
+                .toBranch("someBranch"));

Review Comment:
   I should fix this assertion so it actually checks the expected error 
message;  I think the assertThrows method with 3 params just surfaces this 
message in case the test fails, it doesn't actually check the expected error 
message. Like what's being done in TestReplacePartitions.



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