I have two stream one is of Int and other is of json .In The json Schema there is one key which is some int .So i need to filter the json stream via key comparison with the other integer stream so Is it possible in Flink?
相关问题
- Can we combine both and count and process time Tri
- IOExcpetion while connecting to Twitter Streaming
- Exception when trying to upgrade to flink 1.3.1
- Is global state with multiple workers possible in
- Flink TaskManager timeout?
相关文章
- How to handle errors in custom MapFunction correct
- Flink: Sharing state in CoFlatMapFunction
- Apache Flink (v1.6.0) authenticate Elasticsearch S
- How to filter Apache flink stream on the basis of
- Is it possible to process multiple streams in apac
- Manage state with huge memory usage - querying fro
- MongoDB as datasource to Flink
- Why does Apache Flink need Watermarks for Event Ti
Yes, you can do this kind of stream processing with Flink. The basic building blocks you need from Flink are connected streams, and stateful functions -- here's an example using a RichCoFlatMap:
In this example, only those keys that have been seen on the control stream are passed through the data stream -- all other events are filtered out. I've taken advantage of Flink's managed keyed state and connected streams.
To keep this simple I've ignored your requirement that the data stream has JSON, but you can find examples of how to work with JSON and Flink elsewhere.
Note that your results will be non-deterministic, since you have no control over the timing of the two streams relative to one another. You could manage this by adding event-time timestamps to the streams, and then using a RichCoProcessFunction instead.