pyflink.datastream.data_stream.WindowedStream.side_output_late_data#
- WindowedStream.side_output_late_data(output_tag: pyflink.datastream.output_tag.OutputTag) pyflink.datastream.data_stream.WindowedStream [source]#
Send late arriving data to the side output identified by the given
OutputTag
. Data is considered late after the watermark has passed the end of the window plus the allowed lateness set usingallowed_lateness()
.You can get the stream of late data using
get_side_output()
on theDataStream
resulting from the windowed operation with the sameOutputTag
.Example:
>>> tag = OutputTag("late-data", Types.TUPLE([Types.INT(), Types.STRING()])) >>> main_stream = ds.key_by(lambda x: x[1]) \ ... .window(TumblingEventTimeWindows.of(Time.seconds(5))) \ ... .side_output_late_data(tag) \ ... .reduce(lambda a, b: a[0] + b[0], b[1]) >>> late_stream = main_stream.get_side_output(tag)
New in version 1.16.0.