Hi Lorenzo,

Could you provide some code example to reproduce your question? As I
understand, IterativeStream#keyBy is supported since it is a subclass
of DataStream.

Moreover, we have implemented an unified iteration module for Flink
[1] in Flink ML [2], which relies on Flink 1.15.2. Probably you can
also have a try.

[1] https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=184615300
[2] 
https://github.com/apache/flink-ml/blob/master/flink-ml-iteration/src/main/java/org/apache/flink/iteration/Iterations.java

Lorenzo Nicora <lorenzo.nic...@gmail.com> 于2023年2月18日周六 17:00写道:
>
> Hi all,
>
> I am trying to implement an iterative streaming job that processes the loop 
> with a KeyedProcessFunction.
>
> I need a KeyedProcessFunction to use keyed state and to emit a side-output 
> (that after further transformations becomes the feedback)
>
> Problem is IterativeStream.process() only accepts ProcessFunction, no 
> KeyedProcessFunction.
>
> The main and feedback streams have the same payload type, and I am keying 
> both before starting and closing the iteration.
> I understand I cannot re-key after starting the iteration, as IterativeStream 
> does not support keyBy() and throws an UnsupportedOperationException "Cannot 
> change the input partitioning of an iteration head directly. Apply the 
> partitioning on the input and feedback streams instead."
>
> Is there any way of using keyed state within an iteration?
> BTW,
> I am using Flink 1.15.2 and I am bound to that version
>
> Regards
> Lorenzo



-- 
best,
Zhipeng

Reply via email to