Skip to main content
Ctrl+K
PyFlink 1.20+vvr.11.7.dev0 documentation - Home PyFlink 1.20+vvr.11.7.dev0 documentation - Home
  • API Reference
  • Examples
  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
    • TableEnvironment
    • Table
    • Data Types
    • Window
    • Expressions
    • User Defined Functions
    • Descriptors
    • StatementSet
    • Catalog
  • PyFlink DataStream
  • PyFlink DataFrame
  • PyFlink Common
  • API Reference
  • PyFlink Table
  • Table
  • pyflink.table.Table.flat_map

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.

previous

pyflink.table.Table.flat_aggregate

next

pyflink.table.Table.full_outer_join

On this page
  • Table.flat_map()

This Page

  • Show Source

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.