ZhangChaoming commented on a change in pull request #18151:
URL: https://github.com/apache/flink/pull/18151#discussion_r772879377
##########
File path:
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/runtime/stream/table/DataGeneratorConnectorITCase.java
##########
@@ -69,6 +73,33 @@ public void testTypes() throws Exception {
}
}
- Assert.assertEquals("Unexpected number of results", 10,
results.size());
+ assertThat(results.size()).isEqualTo(10);
+ }
+
+ @Test
+ public void testLimit() throws Exception {
+ final TestingTableEnvironment env = TestingTableEnvironment
+ .create(
+
EnvironmentSettings.newInstance().inStreamingMode().build(),
+ null,
+ new TableConfig());
+
+ env.executeSql("CREATE TABLE datagen_t (\n"
+ + " f0 CHAR(1)\n"
+ + ") WITH ("
+ + " 'connector' = 'datagen'"
+ + ")");
+
+ List<Row> results = new ArrayList<>();
+
+ try (CloseableIterator<Row> iter = env
+ .executeSql("select * from datagen_t limit 5")
+ .collect()) {
+ while (iter.hasNext()) {
+ results.add(iter.next());
+ }
+ }
+
+ assertThat(results.size()).isEqualTo(5);
Review comment:
OK
--
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]