pyflink.table.Table.flat_map#
- Table.flat_map(func: Union[pyflink.table.expression.Expression, pyflink.table.udf.UserDefinedTableFunctionWrapper]) pyflink.table.table.Table [source]#
Performs a flatMap operation with a user-defined table function.
Example:
>>> @udtf(result_types=[DataTypes.INT(), DataTypes.STRING()]) ... def split(x, string): ... for s in string.split(","): ... yield x, s >>> tab.flat_map(split(col('a'), col('b'))) >>> # take all the columns as inputs >>> @udtf(result_types=[DataTypes.INT(), DataTypes.STRING()]) ... def split_row(row: Row): ... for s in row[1].split(","): ... yield row[0], s >>> tab.flat_map(split_row)
- Parameters
func – user-defined table function.
- Returns
The result table.
New in version 1.13.0.