Skip to main content
Ctrl+K
PyFlink 1.20+vvr.11.7.dev0 documentation - Home PyFlink 1.20+vvr.11.7.dev0 documentation - Home
  • API Reference
  • Examples
  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataStream
    • StreamExecutionEnvironment
    • DataStream
    • Functions
    • State
    • Timer
    • Window
    • Checkpoint
    • Side Outputs
    • Asynchronous I/O
    • Connectors
    • Formats
  • PyFlink DataFrame
  • PyFlink Common
  • API Reference
  • PyFlink DataStream
  • DataStream
  • pyflink.datastream.data_stream.AllWindowedStream.reduce

pyflink.datastream.data_stream.AllWindowedStream.reduce#

AllWindowedStream.reduce(reduce_function: Callable | ReduceFunction, window_function: AllWindowFunction | ProcessAllWindowFunction | None = None, output_type: TypeInformation | None = None) → DataStream[source]#

Applies the given window function to each window. The window function is called for each evaluation of the window for each key individually. The output of the window function is interpreted as a regular non-windowed stream.

Arriving data is incrementally aggregated using the given reducer.

Example:

>>> ds.window_all(TumblingEventTimeWindows.of(Time.seconds(5))) \
...   .reduce(lambda a, b: a[0] + b[0], b[1])
Parameters:
  • reduce_function – The reduce function.

  • window_function – The window function.

  • output_type – Type information for the result type of the window function.

Returns:

The data stream that is the result of applying the reduce function to the window.

Added in version 1.16.0.

previous

pyflink.datastream.data_stream.AllWindowedStream.side_output_late_data

next

pyflink.datastream.data_stream.AllWindowedStream.aggregate

On this page
  • AllWindowedStream.reduce()

This Page

  • Show Source

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.