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.with_column

pyflink.dataframe.dataframe.DataFrame.with_column#

DataFrame.with_column(name: str, expr: Expression | Callable[[DataFrame], Expression]) → DataFrame[source]#

Add a new column or replace an existing column.

Parameters:
  • name – Name of the new or existing column.

  • expr – Expression for the column value, or a callable that takes the DataFrame and returns an Expression.

Returns:

A new DataFrame with the added/replaced column.

Example::
>>> df.with_column("c", col("a") + col("b"))
>>> df.with_column("c", lambda df: df["a"] + df["b"])

previous

pyflink.dataframe.dataframe.DataFrame.select

next

pyflink.dataframe.dataframe.DataFrame.with_columns

On this page
  • DataFrame.with_column()

This Page

  • Show Source

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.