OSDir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MapWithState for two keyed stream


Hi all,

Is it possible to define two DataStream sources - one which reads from Kafka, the other reads from HDFS -  and apply mapWithState with CoFlatMapFunction? The idea would be to read historical data from HDFS along with the live stream from Kafka and based on some business  write the output to the sink in correct update order?

Or is it easier to just union those two streams? In mapWithState we should tell from which stream the record originates from to be able to correctly build up the state store.

Many thanks.
Peter