flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-7568) Bring window documentation up-to-date with latest changes and improve
Date Mon, 04 Sep 2017 16:36:00 GMT

    [ https://issues.apache.org/jira/browse/FLINK-7568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16152791#comment-16152791

ASF GitHub Bot commented on FLINK-7568:

Github user aljoscha commented on a diff in the pull request:

    --- Diff: docs/dev/stream/operators/windows.md ---
    @@ -663,25 +623,42 @@ input
         .keyBy(<key selector>)
         .window(<window assigner>)
         .process(new MyProcessWindowFunction())
    +/* ... */
    +class MyWindowFunction extends ProcessWindowFunction[(String, Long), String, String,
TimeWindow] {
    +  def apply(key: String, context: Context, input: Iterable[(String, Long)], out: Collector[String]):
() = {
    +    var count = 0L
    +    for (in <- input) {
    +      count = count + 1
    +    }
    +    out.collect(s"Window ${context.window} count: $count")
    +  }
     {% endhighlight %}
    -### WindowFunction with Incremental Aggregation
    +The example shows a `ProcessWindowFunction` that counts the elements in a window. In
addition, the window function adds information about the window to the output.
    +<span class="label label-danger">Attention</span> Note that using `ProcessWindowFunction`
for simple aggregates such as count is quite inefficient. The next section shows how a `ReduceFunction`
can be combined with a `ProcessWindowFunction` to get both incremental aggregation and the
added information of a `ProcessWindowFunction`.
    -A `WindowFunction` can be combined with either a `ReduceFunction` or a `FoldFunction`
    +### ProcessWindowFunction with Incremental Aggregation
    +A `ProcessWindowFunction` can be combined with either a `ReduceFunction` or a `FoldFunction`
    --- End diff --
    Ha! You went straight for the points that I wanted to do as follow-up work. I keep both
AggregateFunction and a more thorough discussion of per-window/global state out of this and
simply tried to bring the doc up to date and prepare it for those further changes. What do
you think?

> Bring window documentation up-to-date with latest changes and improve
> ---------------------------------------------------------------------
>                 Key: FLINK-7568
>                 URL: https://issues.apache.org/jira/browse/FLINK-7568
>             Project: Flink
>          Issue Type: Bug
>          Components: Documentation
>            Reporter: Aljoscha Krettek
>            Assignee: Aljoscha Krettek
> Off the top of my head:
>  - Make {{ProcessWindowFunction}} the primary window function, threat {{WindowFunction}}
as legacy
>  - Document more specifically how windowing behaves: window boundaries, chaining of several
windowed operations, timestamps of emitted data, what is "key" in a {{ProcessWindowFunction}}...

This message was sent by Atlassian JIRA

View raw message