flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chesnay Schepler <ches...@apache.org>
Subject Re: Can an Aggregate the key from a WindowedStream.aggregate()
Date Sun, 10 Feb 2019 09:48:05 GMT
There are also versions of WindowedStream#aggregate that accept an 
additional WindowFunction/ProcessWindowFunction, which do have access to 
the key via apply()/process() respectively. These functions are called 
post aggregation.

On 08.02.2019 18:24, stephen.alan.connolly@gmail.com wrote:
> If I write my aggregation logic as a WindowFunction then I get access to the key as the
first parameter in WindowFunction.apply(...) however the Javadocs for calling WindowedStream.apply(WindowFunction)
state:
>
>> Note that this function requires that all data in the windows is buffered until the
window
>> is evaluated, as the function provides no means of incremental aggregation.
> Which sounds bad.
>
> It seems the recommended alternative is to use one of the WindowFunction.aggregate(AggregateFunction)
however I cannot see how to get access to the key...
>
> Is my only solution to transform my data into a Tuple if I need access to the key post
aggregation?
>
> Thanks in advance
>
> -stephenc
>


Mime
View raw message