You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Leonard Xu (Jira)" <ji...@apache.org> on 2022/11/01 09:37:00 UTC

[jira] [Updated] (FLINK-3176) Window Apply Website Example

     [ https://issues.apache.org/jira/browse/FLINK-3176?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonard Xu updated FLINK-3176:
------------------------------
    Labels: starter windows  (was: newbie windows)

> Window Apply Website Example
> ----------------------------
>
>                 Key: FLINK-3176
>                 URL: https://issues.apache.org/jira/browse/FLINK-3176
>             Project: Flink
>          Issue Type: Improvement
>          Components: Project Website
>    Affects Versions: 0.10.1
>         Environment: markdown, jekyll
>            Reporter: radu
>            Priority: Minor
>              Labels: starter, windows
>             Fix For: 0.10.1, 1.0.0
>
>   Original Estimate: 336h
>  Remaining Estimate: 336h
>
> I believe i found 2 small inconsistencies in the documentation for the description of Window Apply
> https://ci.apache.org/projects/flink/flink-docs-release-0.10/apis/streaming_guide.html#windows-on-unkeyed-data-streams
>  
> 1) in the example provided I believe it should be corrected to remove the extra > and add ")":
>  
> (new WindowFunction<Tuple2<String,Integer>,Integer, Tuple, Window>() {
>     ...
> }); 
> instead of
>  
> (new WindowFunction<Tuple2<String,Integer>,Integer>, Tuple, Window>() {
>     ...
> }; 
>  
> 2) for AllWindowedStream it seems there is a need for a AllWindowFunction not a WindowFunction
> I would propose to duplicate the existing example to cover also this case, particularly that it has a slightly different interface
>  
> allWindowedStream.apply (new AllWindowFunction<Tuple2<String,Integer>,Integer, TimeWindow>() {
>     public void apply (TimeWindow window,
>             Iterable<Tuple2<String, Integer>> values,
>             Collector<Integer> out) throws Exception {
>         int sum = 0;
>         for (value t: values) {
>             sum += t.f1;
>         }
>         out.collect (new Integer(sum));
>     }
> });



--
This message was sent by Atlassian Jira
(v8.20.10#820010)