@PublicEvolving public interface WindowGroupedTable
GroupWindow
s.Modifier and Type | Method and Description |
---|---|
AggregatedTable |
aggregate(Expression aggregateFunction)
Performs an aggregate operation on a window grouped table.
|
FlatAggregateTable |
flatAggregate(Expression tableAggregateFunction)
Performs a flatAggregate operation on a window grouped table.
|
Table |
select(Expression... fields)
Performs a selection operation on a window grouped table.
|
Table select(Expression... fields)
Example:
windowGroupedTable.select($("key"), $("window").start(), $("value").avg().as("valavg"));
Scala Example:
windowGroupedTable.select('key, 'window.start, 'value.avg as 'valavg)
AggregatedTable aggregate(Expression aggregateFunction)
aggregate(Expression)
with a select statement. The output will be flattened if the output
type is a composite type.
Example:
windowGroupedTable.aggregate(call(MyAggregateFunction.class, $("a"), $("b")).as("x", "y", "z"))
.select($("key"), $("window").start(), $("x"), $("y"), $("z"));
Scala Example:
val aggFunc = new MyAggregateFunction
windowGroupedTable
.aggregate(aggFunc('a, 'b) as ('x, 'y, 'z))
.select('key, 'window.start, 'x, 'y, 'z)
FlatAggregateTable flatAggregate(Expression tableAggregateFunction)
Example:
windowGroupedTable.flatAggregate(call(MyTableAggregateFunction.class, $("a"), $("b")).as("x", "y", "z"))
.select($("key"), $("window").start(), $("x"), $("y"), $("z"));
Scala Example:
val tableAggFunc = new MyTableAggregateFunction
windowGroupedTable
.flatAggregate(tableAggFunc('a, 'b) as ('x, 'y, 'z))
.select('key, 'window.start, 'x, 'y, 'z)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.