rdblue commented on a change in pull request #3998:
URL: https://github.com/apache/iceberg/pull/3998#discussion_r819776672



##########
File path: 
flink/v1.14/flink/src/test/java/org/apache/iceberg/flink/sink/TestFlinkIcebergSink.java
##########
@@ -326,4 +327,51 @@ public void testTwoSinksInDisjointedDAG() throws Exception 
{
     Assert.assertEquals("rightTable", 
rightTable.currentSnapshot().summary().get("direction"));
   }
 
+  @Test
+  public void testOverrideWriteConfigWithUnknownDistributionMode() {
+    AssertHelpers.assertThrows("Override write configuration.",
+            RuntimeException.class, "No enum constant 
org.apache.iceberg.DistributionMode.UNRECOGNIZED",
+            () -> {
+              Map<String, String> newProps = Maps.newHashMap();
+              newProps.put(TableProperties.WRITE_DISTRIBUTION_MODE, 
"UNRECOGNIZED");
+
+              List<Row> rows = createRows("");
+              DataStream<Row> dataStream = 
env.addSource(createBoundedSource(rows), ROW_TYPE_INFO);
+
+              FlinkSink.forRow(dataStream, SimpleDataUtil.FLINK_SCHEMA)
+                      .table(table)
+                      .tableLoader(tableLoader)
+                      .writeParallelism(parallelism)
+                      .properties(newProps)
+                      .append();
+
+              // Execute the program.
+              env.execute("Test Iceberg DataStream.");

Review comment:
       This is the only line that needs to be in the assertion, right? You can 
think of this as a try/catch where you don't want to have an overly broad try 
block, or else you might not catch the exception you want.




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