[
https://issues.apache.org/jira/browse/FLINK-8651?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17321604#comment-17321604
]
Flink Jira Bot commented on FLINK-8651:
---------------------------------------
This issue and all of its Sub-Tasks have not been updated for 180 days. So, it
has been labeled "stale-minor". If you are still affected by this bug or are
still interested in this issue, please give an update and remove the label. In
7 days the issue will be closed automatically.
> Add support for different event-time OVER windows in a query
> ------------------------------------------------------------
>
> Key: FLINK-8651
> URL: https://issues.apache.org/jira/browse/FLINK-8651
> Project: Flink
> Issue Type: New Feature
> Components: Table SQL / API
> Affects Versions: 1.5.0
> Reporter: Fabian Hueske
> Priority: Minor
> Labels: stale-minor
>
> Right now, Table API and SQL queries only support multiple OVER window
> aggregations, but all OVER windows must be of the same type.
> For example the following query is currently supported:
> {code:java}
> SELECT c, b,
> COUNT(a) OVER (PARTITION BY c ORDER BY rowtime RANGE BETWEEN INTERVAL '1'
> SECOND PRECEDING AND CURRENT ROW),
> SUM(a) OVER (PARTITION BY c ORDER BY rowtime RANGE BETWEEN INTERVAL '1'
> SECOND PRECEDING AND CURRENT ROW)
> FROM T1
> {code}
> If we would change the interval or partitioning attribute of the {{SUM(a)}}
> aggregation's window, the query could not be executed.
> We can add support for multiple different windows by splitting the query and
> joining it back.
> This would require an optimizer rule, that rewrites a plan from
> {code:java}
> IN -> OverAgg(window-A, window-B) -> OUT
> {code}
> to
> {code:java}
> /-OverAgg(window-A)-\
> IN -> Calc(uniq-id)-< >-WindowJoin(uniq-id, rowtime) ->
> OUT
> \-OverAgg(window-B)-/
> {code}
> The unique id should consist of three components: the timestamp, the parallel
> index of the function instance, and a counter that just wraps around. One of
> the aggregates can be projected to only the required fields and the window
> join would join on uniq-id and timestamp equality (when we support FOLLOWING
> boundaries, we would have to join on a time range).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)