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
  • PyFlink DataFrame
    • DataFrame
    • DataFrame Creation
    • Input/Output
    • SQL
    • DataType
    • User Defined Functions
    • Configuration
    • GPU Support
    • AI / LLM
  • PyFlink Common
  • API Reference
  • PyFlink DataFrame
  • DataFrame
  • pyflink.dataframe.dataframe.DataFrame.pipe

pyflink.dataframe.dataframe.DataFrame.pipe#

DataFrame.pipe(func: Callable[[...], T], *args: Any, **kwargs: Any) → T[source]#

Apply a chainable function to the DataFrame.

Enables fluent method chaining with user-defined functions. The DataFrame is passed as the first argument to func.

Parameters:
  • func – A function whose first argument is a DataFrame.

  • *args – Additional positional arguments passed to func.

  • **kwargs – Additional keyword arguments passed to func.

Returns:

The return value of func.

Example::
>>> import pyflink.dataframe as pf
>>> def add_total(df):
...     return df.with_column("total", pf.col("a") + pf.col("b"))
...
>>> def filter_positive(df, col_name):
...     return df.filter(pf.col(col_name) > 0)
...
>>> result = (
...     df.pipe(add_total)
...       .pipe(filter_positive, "total")
... )

previous

pyflink.dataframe.dataframe.DataFrame.map_batches

next

pyflink.dataframe.dataframe.DataFrame.limit

On this page
  • DataFrame.pipe()

This Page

  • Show Source

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.