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

Table.window(window: pyflink.table.window.GroupWindow) → pyflink.table.table.GroupWindowedTable[source]#

Defines group window on the records of a table.

A group window groups the records of a table by assigning them to windows defined by a time or row interval.

For streaming tables of infinite size, grouping into windows is required to define finite groups on which group-based aggregates can be computed.

For batch tables of finite size, windowing essentially provides shortcuts for time-based groupBy.

Note

Computing windowed aggregates on a streaming table is only a parallel operation if additional grouping attributes are added to the group_by() clause. If the group_by() only references a GroupWindow alias, the streamed table will be processed by a single task, i.e., with parallelism 1.

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

window – A GroupWindow created from Tumble, Session or Slide.

Returns

A group windowed table.

previous

pyflink.table.Table.where

next

pyflink.table.GroupedTable.select

Show Source

Created using Sphinx 4.5.0.