Yes, I want count all the elements. But I can't do cumulative.
eg:
distinctOrder.map(new MapFunction<Order, Object>() {
@Override
public Object map(Order value) throws Exception {
return null;
}
}).setParallelism(1).print();
------------------------------------------------------------------
发送时间:2018年1月12日(星期五) 22:37
主 题:Re: How can I count the element in datastream
Hi!
Do you mean that you want to count all elements across all partitions of a
DataStream?
To do that, you'll need to transform the DataStream with an operator of
parallelism 1, e.g.
DatatStream<String> stream = ...;
stream.map(new CountingMap<>()).setParallelism(1);
Cheers,
Gordon
--
Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/