Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataStream
    • StreamExecutionEnvironment
    • DataStream
    • Functions
    • State
    • Timer
    • Window
    • Checkpoint
    • Side Outputs
    • Connectors
    • Formats
  • PyFlink Common

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
Show Source

Created using Sphinx 5.3.0.