You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2021/05/01 03:53:53 UTC

[GitHub] [hudi] lonelyGhostisdog commented on a change in pull request #2900: [HUDI-1781] Fix Flink streaming reader throws ClassCastException

lonelyGhostisdog commented on a change in pull request #2900:
URL: https://github.com/apache/hudi/pull/2900#discussion_r624409640



##########
File path: hudi-flink/src/test/java/org/apache/hudi/table/HoodieDataSourceITCase.java
##########
@@ -390,6 +392,26 @@ void testWriteNonPartitionedTable(ExecMode execMode) {
     assertRowsEquals(result, "[id1,Sophia,18,1970-01-01T00:00:05,par5]");
   }
 
+  @ParameterizedTest
+  @EnumSource(value = ExecMode.class)
+  void testStreamReadEmptyTablePath(ExecMode execMode) throws Exception {
+    // create an empty table
+    Configuration conf = TestConfigurations.getDefaultConf(tempFile.getAbsolutePath());
+    StreamerUtil.initTableIfNotExists(conf);
+
+    // create a flink source table
+    Map<String, String> options = new HashMap<>();
+    options.put(FlinkOptions.PATH.key(), tempFile.getAbsolutePath());
+    options.put(FlinkOptions.READ_AS_STREAMING.key(), "true");
+    options.put(FlinkOptions.TABLE_TYPE.key(), FlinkOptions.TABLE_TYPE_MERGE_ON_READ);
+    String createHoodieTable = TestConfigurations.getCreateHoodieTableDDL("t1", options);
+    streamTableEnv.executeSql(createHoodieTable);
+
+    // execute query and assert throws exception
+    assertThrows(HoodieException.class, () -> execSelectSql(streamTableEnv, "select * from t1", 10), "No successful commits under path " + tempFile.getAbsolutePath());

Review comment:
       done.




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

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