RussellSpitzer commented on code in PR #4800:
URL: https://github.com/apache/iceberg/pull/4800#discussion_r877558934
##########
spark/v3.2/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestMergeOnReadDelete.java:
##########
@@ -37,4 +52,51 @@ protected Map<String, String> extraTableProperties() {
TableProperties.DELETE_MODE, "merge-on-read"
);
}
+
+
+ @Test
+ public void testCommitUnknownException() throws IOException,
NoSuchTableException {
+ createAndInitTable("id INT, dep STRING, category STRING");
+
+ // write an unpartitioned file
+ append(tableName, "{ \"id\": 1, \"dep\": \"hr\", \"category\": \"c1\"}");
+ append(tableName, "{ \"id\": 2, \"dep\": \"hr\", \"category\": \"c1\" }\n"
+
+ "{ \"id\": 3, \"dep\": \"hr\", \"category\": \"c1\" }");
+
+ Table table = validationCatalog.loadTable(tableIdent);
+
+ RowDelta newRowDelta = table.newRowDelta();
+ RowDelta spyNewRowDelta = spy(newRowDelta);
+ doAnswer(invocation -> {
+ newRowDelta.commit();
+ throw new CommitStateUnknownException(new RuntimeException("Datacenter
on Fire"));
+ }).when(spyNewRowDelta).commit();
+
+ Table spyTable = spy(table);
+ when(spyTable.newRowDelta()).thenReturn(spyNewRowDelta);
+ SparkTable sparkTable = new SparkTable(spyTable, false);
+
Review Comment:
nit: double space
--
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]