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.GroupWindowedTable.group_by

pyflink.table.GroupWindowedTable.group_by#

GroupWindowedTable.group_by(*fields: Expression) → WindowGroupedTable[source]#

Groups the elements by a mandatory window and one or more optional grouping attributes. The window is specified by referring to its alias.

If no additional grouping attribute is specified and if the input is a streaming table, the aggregation will be performed by a single task, i.e., with parallelism 1.

Aggregations are performed per group and defined by a subsequent select() clause similar to SQL SELECT-GROUP-BY query.

Example:

>>> from pyflink.table.expressions import col, lit
>>> tab.window(Tumble.over(lit(10).minutes).on(col('rowtime')).alias('w')) \
...     .group_by(col('w')) \
...     .select(col('a').sum.alias('a'),
...             col('w').start.alias('b'),
...             col('w').end.alias('c'),
...             col('w').rowtime.alias('d'))
Parameters:

fields – Group keys.

Returns:

A window grouped table.

previous

pyflink.table.GroupedTable.flat_aggregate

next

pyflink.table.WindowGroupedTable.select

On this page
  • GroupWindowedTable.group_by()

This Page

  • Show Source

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.