pvary commented on code in PR #12191:
URL: https://github.com/apache/iceberg/pull/12191#discussion_r1949097510


##########
flink/v1.20/flink/src/test/java/org/apache/iceberg/flink/source/TestIcebergSourceSql.java:
##########
@@ -162,4 +173,74 @@ public void testWatermarkOptionsDescending() throws 
Exception {
         expected,
         SCHEMA_TS);
   }
+
+  @Test
+  public void testWatermarkInvalidConfig() {
+    CATALOG_EXTENSION.catalog().createTable(TestFixtures.TABLE_IDENTIFIER, 
SCHEMA_TS);
+
+    String flinkTable = "`default_catalog`.`default_database`.flink_table";
+    try {
+      SqlHelpers.sql(
+          getStreamingTableEnv(),
+          "CREATE TABLE %s "
+              + "(t1 TIMESTAMP(6), "
+              + "t2 BIGINT,"
+              + "eventTS AS CAST(t1 AS TIMESTAMP(3)), "
+              + "WATERMARK FOR eventTS AS SOURCE_WATERMARK()) WITH %s",
+          flinkTable,
+          SqlBase.toWithClause(getConnectorOptions()));
+
+      assertThatThrownBy(
+              () -> SqlHelpers.sql(getStreamingTableEnv(), "SELECT * FROM %s", 
flinkTable))
+          .isInstanceOf(NullPointerException.class)
+          .hasMessage("watermark-column needs to be configured to use source 
watermark.");
+    } finally {
+      SqlHelpers.sql(getStreamingTableEnv(), "DROP TABLE IF EXISTS %s", 
flinkTable);

Review Comment:
   In `TestSqlBase` we have several tests where we create tables, and we expect 
that they are removed because of the `@TempDir` is removed. So we can simply 
just do the same here.
   
   WDYT?



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to