Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
    • TableEnvironment
    • Table
    • Data Types
    • Window
    • Expressions
    • User Defined Functions
    • Descriptors
    • StatementSet
    • Catalog
  • PyFlink DataStream
  • PyFlink Common

pyflink.table.Table.map#

Table.map(func: Union[str, pyflink.table.expression.Expression, pyflink.table.udf.UserDefinedScalarFunctionWrapper]) → pyflink.table.table.Table[source]#

Performs a map operation with a user-defined scalar function.

Example:

>>> add = udf(lambda x: Row(x + 1, x * x), result_type=DataTypes.Row(
... [DataTypes.FIELD("a", DataTypes.INT()), DataTypes.FIELD("b", DataTypes.INT())]))
>>> tab.map(add(col('a'))).alias("a", "b")
>>> # take all the columns as inputs
>>> identity = udf(lambda row: row, result_type=DataTypes.Row(
... [DataTypes.FIELD("a", DataTypes.INT()), DataTypes.FIELD("b", DataTypes.INT())]))
>>> tab.map(identity)
Parameters

func – user-defined scalar function.

Returns

The result table.

New in version 1.13.0.

previous

pyflink.table.Table.limit

next

pyflink.table.Table.minus

Show Source

Created using Sphinx 4.5.0.