Sorry, I forgot to CC the user mailing list in my reply. 2018-04-12 17:27 GMT+02:00 Fabian Hueske <fhue...@gmail.com>:
> Hi, > > Assuming you are using event time, the right function to generate a row > time attribute from a window would be "w1.rowtime" instead of "w1.start". > > The reason why Flink is picky about this is that we must ensure that the > result rows of the windows are aligned with the watermarks of the stream. > > Best, Fabian > > > Ivan Wang <ivan.wang2...@gmail.com> schrieb am So., 8. Apr. 2018, 22:26: > >> Hi all, >> >> >> >> I'd like to use 2 window group in a chain in my program as below. >> >> >> >> Table myTable = cTable >> .window(Tumble.*over*("15.seconds").on("timeMill").as("w1")) >> .groupBy("symbol, w1").select("w1.start as start, w1.end as end, >> symbol, price.max as p_max, price.min as p_min") >> .window(Slide.*over*("150.rows").every("1.rows").on("start").as( >> "w2")) >> .groupBy("symbol, w2").select("w2.start, w2.end, symbol, >> p_max.max, p_min.min") >> ; >> >> >> >> >> >> However, it throws error: SlidingGroupWindow('w2, 'start, 150.rows, >> 1.rows) is invalid: Sliding window expects a time attribute for grouping in >> a stream environment. >> >> at org.apache.flink.table.plan.logical.LogicalNode. >> failValidation(LogicalNode.scala:149) >> >> at org.apache.flink.table.plan.logical.WindowAggregate. >> validate(operators.scala:658) >> >> at org.apache.flink.table.api.WindowGroupedTable.select( >> table.scala:1159) >> >> at org.apache.flink.table.api.WindowGroupedTable.select( >> table.scala:1179) >> >> at minno.gundam.ReadPattern.main(ReadPattern.java:156) >> >> >> >> Is there any way to assign time attribute after the first groupBy (w1)? >> >> >> >> Thanks >> >> Ivan >> >> >> >>