JingGe commented on a change in pull request #17888:
URL: https://github.com/apache/flink/pull/17888#discussion_r758176389
##########
File path:
flink-connectors/flink-connector-hbase-2.2/src/test/java/org/apache/flink/connector/hbase2/HBaseConnectorITCase.java
##########
@@ -250,13 +252,23 @@ public void testTableSink() throws Exception {
+ " FROM "
+ TEST_TABLE_1;
+ TableResult tableResult = tEnv.executeSql(query);
+
// wait to finish
- tEnv.executeSql(query).await();
+ tableResult.await();
+
+ assertEquals(
+ "Expected INSERT rowKind", RowKind.INSERT,
tableResult.collect().next().getKind());
// start a batch scan job to verify contents in HBase table
TableEnvironment batchEnv = TableEnvironment.create(batchSettings);
batchEnv.executeSql(table2DDL);
+ Table countTable =
+ batchEnv.sqlQuery("SELECT COUNT(h.rowkey) FROM " +
TEST_TABLE_2 + " AS h");
Review comment:
This is an additional check before fetching the concrete data of all
row. the idea of checking COUNT is to see whether all rows have been inserted
successfully. If this check failed, we will know that there was issue with the
INSERT not the SELECT query.
--
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]