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

Table.flat_map(func: Union[str, 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.

previous

pyflink.table.Table.flat_aggregate

next

pyflink.table.Table.full_outer_join

Show Source

Created using Sphinx 4.5.0.