Re: What is the best way to aggregate data over a long window

2024-05-17 Thread gongzhongqiang
Hi Sachin, We can optimize this problem in the following ways: - use org.apache.flink.streaming.api.datastream.WindowedStream#aggregate(org.apache.flink.api.common.functions.AggregateFunction) to reduce number of data - use TTL to clean data which are not need - enble incremental checkpoint - us

Re: What is the best way to aggregate data over a long window

2024-05-17 Thread Sachin Mittal
Hi, I am doing the following 1. Use reduce function where the data type of output after windowing is the same as the input. 2. Where the output of data type after windowing is different from that of input I use the aggregate function. For example: SingleOutputStreamOperator data = reducedPlaye

Re: What is the best way to aggregate data over a long window

2024-05-20 Thread gongzhongqiang
Hi Sachin, `performing incremental aggregation using stateful processing` is same as `windows with agg`, but former is more flexible.If flink window can not satisfy your performance needs ,and your business logic has some features that can be customized for optimization. You can choose the former