pyflink.table.Table.map#
- Table.map(func: Union[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.