Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-2999

Support connected keyed streams

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0.0
    • 1.0.1
    • 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());
        }
      
        // ...
      
      }
      

      Attachments

        Activity

          People

            sewen Stephan Ewen
            fhueske Fabian Hueske
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: