godfreyhe commented on a change in pull request #12577:
URL: https://github.com/apache/flink/pull/12577#discussion_r440742246
##########
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:
make sense to me
----------------------------------------------------------------
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]