java窗体程序有错误_在Apache Flink Java中创建滚动窗口时出错

StreamExecutionEnvironment fsEnv = StreamExecutionEnvironment.getExecutionEnvironment();

StreamTableEnvironment tableEnv = StreamTableEnvironment.create(fsEnv);

fsEnv.setStreamTimeCharacteristic(TimeCharacteristic.EventTime);

TupleTypeInfo<Tuple5<Integer, Timestamp, Double, Long, String>> tupleType = new TupleTypeInfo<>(

Types.INT(),

Types.SQL_TIMESTAMP(),

Types.DOUBLE(),

Types.LONG(),

Types.STRING());

DataStream<Tuple5<Integer, Timestamp, Double, Long, String>> dsTuple =

tableEnv.toAppendStream(HTable, tupleType);

//When I run below code I get this error: Caused by: java.lang.RuntimeException: Rowtime timestamp is null. Please make sure that a proper TimestampAssigner is defined and the stream environment uses the EventTime time characteristic.

Table table = tableEnv.fromDataStream(dsTuple, "mID, dateTime.rowtime, mValue, unixDateTime, mType");

DataStream stream = tableEnv.toAppendStream(table, Row.class);

stream.print();

//When I run below code I get this error: Exception in thread "main" java.lang.UnsupportedOperationException: Event-time grouping windows on row intervals are currently not supported.

Table table = tableEnv.fromDataStream(dsTuple, "mID, dateTime.rowtime, measurementValue, unixDateTime, measurementType")

.window(Tumble.over("2.rows")

.on("dateTime")

.as("a"))

.groupBy("a")

.select("AVG(mValue)");

DataStream stream = tableEnv.toAppendStream(table, Row.class);

stream.print();

表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
相关推荐
©️2020 CSDN 皮肤主题: 数字20 设计师:CSDN官方博客 返回首页