flink streaming documentation

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

flink streaming documentation

Radu Tudoran

Hi,

 

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));
    }
});

 

Regards,

 

Radu

 

Reply | Threaded
Open this post in threaded view
|

Re: flink streaming documentation

Matthias J. Sax-2
Thanks for reporting!

Would you like to fix this and open a PR?


-Matthias

On 12/15/2015 04:43 AM, Radu Tudoran wrote:

> Hi,
>
>  
>
> 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)); } });|
>
>  
>
> Regards,
>
>  
>
> Radu
>
>  
>


signature.asc (836 bytes) Download Attachment