Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.0.0
-
None
-
None
Description
It would be nice to add support for connected keyed streams to enable key-partitioned state in Co*Functions.
This could be done by simply connecting two keyed Streams or adding a new method to connect and key two streams as one operation.
DataStream<X> s1 = ... DataStream<Y> s2 = ... // alternative 1 s1 .keyBy(0) .connect(s2.keyBy(1)) .map(new KeyedCoMap()); // alternative 2 s1 .connectByKey(s2, 0, 1) .map(new KeyedCoMap()); public class KeyedCoMap implements RichCoMapFunction<X,Y,Z> { OperatorState<A> s; public void open() { s = getRuntimeContext().getKeyValueState("abc", A.class, new A()); } // ... }