Hi all,
I'd like to use 2 window group in a chain in my program as below.
Table myTable = cTable
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)?
Ivan
|
Sorry, I forgot to CC the user mailing list in my reply. 2018-04-12 17:27 GMT+02:00 Fabian Hueske <[hidden email]>:
|
Thanks Fabian. I tried to use "rowtime" and Flink tells me below exception: Exception in thread "main" org.apache.flink.table.api.ValidationException: SlidingGroupWindow('w2, 'end, 150.rows, 1.rows) is invalid: Event-time grouping windows on row intervals in a stream environment are currently not supported. Then I tried to OverWindows, luckily it can serve my requirement as well. Now my table query is like below .window(Tumble.over("15.seconds").on("timeMill").as("w1")) It works and I can get what I want. However, the result is not ordered by the rowtime (here I use "end" as alias). Is this by default and any thing to get it ordered? Below is the entire requirement, Basically there's one raw stream (r1), and I group it first by time as w1 then by window count as w2. I'd like to compare the "price" field in every raw event with the same field in the most close preceding event in w2. If condition meets, I'd like to use the price value and timestamp in that event to get one matching event from another raw stream (r2). CEP sounds to be a good idea. But I need to refer to event in other stream (r2) in current pattern condition (r1). Is it possible to do this using CEP? Thanks Ivan On Mon, Apr 16, 2018 at 4:01 PM, Fabian Hueske <[hidden email]> wrote:
|
This sounds like a windowed join between the raw stream and the aggregated stream. It might be possible to do the "lookup" in the second raw stream with another windowed join. If not, you can fall back to the DataStream API / ProcessFunction and implement the lookup logic as you need it.2018-04-18 3:03 GMT+02:00 Ivan Wang <[hidden email]>:
|
Free forum by Nabble | Edit this page |