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
  • Functions
  • pyflink.datastream.functions.ReduceFunction

pyflink.datastream.functions.ReduceFunction#

class ReduceFunction[source]#

Base interface for Reduce functions. Reduce functions combine groups of elements to a single value, by taking always two elements and combining them into one. Reduce functions may be used on entire data sets, or on grouped data sets. In the latter case, each group is reduced individually.

The basic syntax for using a ReduceFunction is as follows:

::
>>> ds = ...
>>> new_ds = ds.key_by(lambda x: x[1]).reduce(MyReduceFunction())

Methods

close()

open(runtime_context)

reduce(value1, value2)

The core method of ReduceFunction, combining two values into one value of the same type.

previous

pyflink.datastream.functions.CoFlatMapFunction

next

pyflink.datastream.functions.AggregateFunction

On this page
  • ReduceFunction

This Page

  • Show Source

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.