ivywenyuan
ivywenyuan

Reputation: 39

How to use Flink Java API to count distinct in a DataStream

I met with the same problem as How to count unique words in a stream? in Flink programming. However, the answer used Scala API to solve the problem. Does Flink Java API support filterWithState transform ? Can Java API solve the problem?

Upvotes: 3

Views: 1729

Answers (1)

David Anderson
David Anderson

Reputation: 43717

filterWithState and mapWithState are bits of syntactic sugar for the Flink Scala API that aren't available in the Java API. But the underlying mechanisms for writing stateful transformations and filters are indeed there in Java -- see the documentation.

Upvotes: 1

Related Questions