@PublicEvolving public interface GroupWindowedTable
GroupWindow
s.Modifier and Type | Method and Description |
---|---|
WindowGroupedTable |
groupBy(Expression... fields)
Groups the elements by a mandatory window and one or more optional grouping attributes.
|
WindowGroupedTable groupBy(Expression... fields)
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:
tab.window([groupWindow].as("w")).groupBy($("w"), $("key")).select($("key"), $("value").avg());
Scala Example:
tab.window([groupWindow] as 'w)).groupBy('w, 'key).select('key, 'value.avg)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.