Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataFrame
    • DataFrame
    • DataFrame Creation
    • Input/Output
    • SQL
    • Data Types
    • User Defined Functions
    • Configuration
    • Catalog
    • GPU Support
    • AI / LLM
  • PyFlink Multimodal
  • PyFlink DataStream
  • PyFlink Common

pyflink.dataframe.DataFrame.pipe#

DataFrame.pipe(func: Callable[[...], pyflink.dataframe.dataframe.T], *args: Any, **kwargs: Any) → pyflink.dataframe.dataframe.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.flat_map

next

pyflink.dataframe.DataFrame.to_table

Show Source

Created using Sphinx 4.5.0.