flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Udhayakumar Murugesan <udhayakumar.muruge...@gmail.com>
Subject Joining two aggregated streams
Date Wed, 05 Jul 2017 11:30:59 GMT
I was trying to join two keyed streams in a particular way and get a
combined stream.
For example:
Lets say I call the two streams as X and Y.
The X stream contains:



The Y stream contains:



My objective is to join these two streams and get the combined value as
described. I want a keywise aggregated data of "Value" field from the X
stream. In the Y stream I want a keywise aggregation of "Value" field based
on "Flag1" i.e., the output will be set of aggregated values. I want to
join these two streams by maintaining a keyed window and that window gets
triggered only when the "Flag2" value of a particular key in the Y stream
is "1". These flag values are available only with Y stream and not with the
X stream. Thus my end result should look like:



The timings for each of the rows in each stream are such that by the time
the Flag2 value is 1 in stream Y (indicates some sort of end of a session),
all the rows in stream X are also already available.

I tried to maintains state value inside my join function to get to the
output. But I dont know how to query the state value and when to do it. Can
anyone please suggest some solution?

View raw message