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.AggregatedTable.select

pyflink.table.table.AggregatedTable.select#

AggregatedTable.select(*fields: Expression) → Table[source]#

Performs a selection operation after an aggregate operation. The field expressions cannot contain table functions and aggregations.

Example: “”

>>> agg = udaf(lambda a: (a.mean(), a.max()),
...               result_type=DataTypes.ROW(
...                   [DataTypes.FIELD("a", DataTypes.FLOAT()),
...                    DataTypes.FIELD("b", DataTypes.INT())]),
...               func_type="pandas")
>>> tab.aggregate(agg(col('a')).alias("a", "b")).select(col('a'), col('b'))
>>> # take all the columns as inputs
>>> # pd is a Pandas.DataFrame
>>> agg_row = udaf(lambda pd: (pd.a.mean(), pd.b.max()),
...               result_type=DataTypes.ROW(
...                   [DataTypes.FIELD("a", DataTypes.FLOAT()),
...                    DataTypes.FIELD("b", DataTypes.INT())]),
...               func_type="pandas")
>>> tab.group_by(col('a')).aggregate(agg.alias("a", "b")).select(col('a'), col('b'))
Parameters:

fields – Expression string.

Returns:

The result table.

previous

pyflink.table.OverWindowedTable.select

next

pyflink.table.table.FlatAggregateTable.select

On this page
  • AggregatedTable.select()

This Page

  • Show Source

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.