For an example of a similar join implemented as a RichCoFlatMap, see [1]. For more background, the Flink docs have a tutorial [2] on how to work with connected streams.
[1] https://github.com/apache/flink-training/tree/master/rides-and-fares [2] https://ci.apache.org/projects/flink/flink-docs-stable/learn-flink/etl.html#connected-streams On Wed, Mar 24, 2021 at 8:55 AM Matthias Pohl <matth...@ververica.com> wrote: > 1. yes - the same key would affect the same state variable > 2. you need a join to have the same operator process both streams > > Matthias > > On Wed, Mar 24, 2021 at 7:29 AM vishalovercome <vis...@moengage.com> > wrote: > >> Let me make the example more concrete. Say O1 gets as input a data stream >> T1 >> which it splits into two using some function and produces DataStreams of >> type T2 and T3, each of which are partitioned by the same key function TK. >> Now after O2 processes a stream, it could sometimes send the stream to O3 >> (T4) using the same key function again. Now I want to know whether: >> >> 1. Data from streams T3 with key K and T4 with key K end up affecting the >> state variables for the same key K or different. I would think that would >> be >> the case but wanted a confirmation >> 2. An explicit join is needed or not, i.e. whether this will achieve what >> I >> want: >> >> result2 = T1.filter(fn2).keyBy(TK).map(richfn2).keyBy(TK).map(whatever O3 >> does) >> result3 = T1.filter(fn3).keyBy(TK).map(whatever O3 does) >> >> >> >> >> -- >> Sent from: >> http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/ > >