wuchong commented on a change in pull request #12577:
URL: https://github.com/apache/flink/pull/12577#discussion_r440713134



##########
File path: docs/try-flink/table_api.md
##########
@@ -462,14 +469,17 @@ public class SpendReport {
         tEnv.registerTableSource("transactions", new 
UnboundedTransactionTableSource());
         tEnv.registerTableSink("spend_report", new SpendReportTableSink());
 
-        tEnv
+        Table table = tEnv
             .scan("transactions")
             .window(Tumble.over("1.hour").on("timestamp").as("w"))
             .groupBy("accountId, w")
-            .select("accountId, w.start as timestamp, amount.sum")
-            .insertInto("spend_report");
+            .select("accountId, w.start as timestamp, amount.sum");
 
-        env.execute("Spend Report");
+        // trigger execution
+        TableResult tableResult = table.executeInsert("spend_report");
+        // wait job finished
+        tableResult.getJobClient().get()

Review comment:
       Big +1 for this. We also have the same feeling and had some discussion 
around this. Maybe we can also have a `TableResult.awaitCompletion()` for this. 




----------------------------------------------------------------
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:
[email protected]


Reply via email to