0
votes

I tried to use flink sql window api: https://ci.apache.org/projects/flink/flink-docs-release-1.3/dev/table_api.html#group-windows

StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
StreamTableEnvironment tableEnv = TableEnvironment.getTableEnvironment(env);

// ingest a DataStream from an external source
DataStream<Tuple3<Long, String, Integer>> ds = env.addSource(...);
// register the DataStream as table "Orders"
tableEnv.registerDataStream("Orders", ds, "user, product, amount");

// compute SUM(amount) per day (in event-time)
Table result1 = tableEnv.sql(
  "SELECT user, " +
  "  TUMBLE_START(rowtime(), INTERVAL '1' DAY) as wStart,  " +
  "  SUM(amount) FROM Orders " + 
  "GROUP BY TUMBLE(rowtime(), INTERVAL '1' DAY), user");

show the error:

No match found for function signature rowtime()

Please give me a more detail example about flink-sql-window api with rowtime.Thx.

1

1 Answers

1
votes

At the moment the docs are a bit out of sync, but the community is working on it in a separate branch. Flink 1.3 introduces so called "time attributes" in order to access, express, and work with time more explicitly in the future.

You can find more information in the current documentation draft. Some examples how to use the time attributes in a table program can be found here.