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 15:32:00 GMT

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

ASF GitHub Bot commented on FLINK-7568:
---------------------------------------

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

    https://github.com/apache/flink/pull/4634#discussion_r136843813
  
    --- 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 %}
     </div>
     </div>
     
    -### 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`
to
    +### ProcessWindowFunction with Incremental Aggregation
    +
    +A `ProcessWindowFunction` can be combined with either a `ReduceFunction` or a `FoldFunction`
to
    --- End diff --
    
    Do we want to still mention FoldFunction here without mentioning it has been deprecated?
Maybe we should talk about AggregateFunction instead.


> 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
(v6.4.14#64029)

Mime
View raw message