Hi Adrienne, you can only use DataStream#reinterpretAsKeyedStream on a stream, which has previously been keyed/partitioned by Flink with exactly the same KeySelector as given to reinterpretAsKeyedStream. It does not work with a key-partitioned stream, which has been partitioned by any other process.
Best, Konstantin On Fri, Mar 29, 2019 at 11:47 PM Rong Rong <walter...@gmail.com> wrote: > Hi Adrienne, > > I think you should be able to reinterpretAsKeyedStream by passing in a > DataStreamSource based on the ITCase example [1]. > Can you share the full code/error logs or the IAE? > > -- > Rong > > [1] > https://github.com/apache/flink/blob/release-1.7.2/flink-streaming-java/src/test/java/org/apache/flink/streaming/api/datastream/ReinterpretDataStreamAsKeyedStreamITCase.java#L98 > > On Fri, Mar 29, 2019 at 6:09 AM Adrienne Kole <adrienneko...@gmail.com> > wrote: > >> Dear community, >> >> I have a use-case where sources are keyed. >> For example, there is a source function with parallelism 10, and each >> instance has its own key. >> I used reinterpretAsKeyedStream to convert source DataStream to >> KeyedStream, however, I get an IllegalArgument exception. >> Is reinterpretAsKeyedStream can be used with source operators as well, or >> should the operator to be used be already partitioned (by keyby(..)) ? >> >> Thanks, >> Adrienne >> > -- Konstantin Knauf | Solutions Architect +49 160 91394525 <https://www.ververica.com/> Follow us @VervericaData -- Join Flink Forward <https://flink-forward.org/> - The Apache Flink Conference Stream Processing | Event Driven | Real Time -- Data Artisans GmbH | Invalidenstrasse 115, 10115 Berlin, Germany -- Data Artisans GmbH Registered at Amtsgericht Charlottenburg: HRB 158244 B Managing Directors: Dr. Kostas Tzoumas, Dr. Stephan Ewen