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

DataFrame.with_column(name: str, expr: Union[pyflink.table.expression.Expression, Callable[[pyflink.dataframe.dataframe.DataFrame], pyflink.table.expression.Expression]]) → pyflink.dataframe.dataframe.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.select

next

pyflink.dataframe.DataFrame.with_columns

Show Source

Created using Sphinx 4.5.0.