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
  • PyFlink DataStream
  • PyFlink DataFrame
    • DataFrame
    • DataFrame Creation
    • Input/Output
    • SQL
    • DataType
    • User Defined Functions
    • Configuration
    • GPU Support
    • AI / LLM
  • PyFlink Common
  • API Reference
  • PyFlink DataFrame
  • DataFrame
  • pyflink.dataframe.dataframe.GroupedDataFrame.agg

pyflink.dataframe.dataframe.GroupedDataFrame.agg#

GroupedDataFrame.agg(*aggs: Expression) → DataFrame[source]#

Apply aggregation expressions.

Parameters:

*aggs – Aggregation expressions.

Returns:

A new DataFrame with aggregation results.

Example::
>>> import pyflink.dataframe as pf
>>> df = pf.from_records(
...     [("A", 1), ("A", 2), ("B", 3)],
...     schema=["category", "value"],
... )
>>> # Group by and aggregate
>>> result = df.group_by("category").agg(
...     pf.col("category"),
...     pf.col("value").sum.alias("total")
... )

previous

pyflink.dataframe.dataframe.DataFrame.llm

next

pyflink.dataframe.dataframe.col

On this page
  • GroupedDataFrame.agg()

This Page

  • Show Source

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.