Hi Vishal, I'm not 100% sure what you're trying to do. But the partitioning by a key just relies on the key on the used parallelism. So, I guess, what you propose should work. You would have to rely on some join function, though, when merging two input operators into one again.
I hope that was helpful. Best, Matthias On Tue, Mar 23, 2021 at 3:29 PM vishalovercome <vis...@moengage.com> wrote: > Suppose i have a job with 3 operators with the following job graph: > > O1 => O2 // data stream partitioned by keyBy > O1 => O3 // data stream partitioned by keyBy > O2 => O3 // data stream partitioned by keyBy > > If operator O3 receives inputs from two operators and both inputs have the > same type and value for a key then will the two streams end up in the same > sub-task and therefore affect the same state variables keyed to that > particular key? Do the streams themselves have to have the same type or is > it enough that just the keys of each of the input streams have the same > type > and value? > > If they're not guaranteed to affect the same state then how can we achieve > the same? I would prefer to use the simple > RichMapFunction/RichFlatmapFunction for modelling my operators as opposed > to > any join function. > > > > -- > Sent from: > http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/