pyflink.table.Table.flat_map#
- Table.flat_map(func: Expression | UserDefinedTableFunctionWrapper) 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.
Added in version 1.13.0.