hi
  我有这样一个场景,以多个相同的key.做keyby,
DataStream resStream =  demoStream.keyBy(groupKeys)
            .flatMap(new MyFlatmapFunction())
            .keyBy(groupKeys)
            .process(new MyProcessFunction())
            .keyBy(groupKeys)
            .timeWindow(Time.seconds(1))
            .aggregate(new MyAggFunction())
            .keyBy(groupKeys)
            .timeWindow(Time.seconds(1))
            .process(new MyKeyProcessFunction());

我想通过DataStreamUtils.reinterpretasKeyedStream来改写这个流程,我自己尝试这样写下,,
int[] groupKeys = new int[]{0,2,3};

DataStream proStream = DataStreamUtils.reinterpretAsKeyedStream(demoStream, new 
MyKeySelector2(groupKeys) )  //  MyKeySelector2 自己实现keySelector             
.flatMap(new MyFlatmapFunction())
我这样写发现数据流经过flatmap后并不是返回一个keyedstream
,请问是哪里有问题吗?请问该如何使用DataStreamUtils.reinterpretasKeyedStream

Reply via email to