@PublicEvolving public interface GroupedTable
Modifier and Type | Method and Description |
---|---|
AggregatedTable |
aggregate(Expression aggregateFunction)
Performs an aggregate operation with an aggregate function.
|
AggregatedTable |
aggregate(String aggregateFunction)
Performs an aggregate operation with an aggregate function.
|
FlatAggregateTable |
flatAggregate(Expression tableAggFunction)
Performs a flatAggregate operation on a grouped table.
|
FlatAggregateTable |
flatAggregate(String tableAggFunction)
Performs a flatAggregate operation on a grouped table.
|
Table |
select(Expression... fields)
Performs a selection operation on a grouped table.
|
Table |
select(String fields)
Performs a selection operation on a grouped table.
|
Table select(String fields)
Example:
tab.groupBy("key").select("key, value.avg + ' The average' as average")
Table select(Expression... fields)
Scala Example:
tab.groupBy('key).select('key, 'value.avg + " The average" as 'average)
AggregatedTable aggregate(String aggregateFunction)
aggregate(String)
with a select statement. The output will be flattened if the
output type is a composite type.
Example:
AggregateFunction aggFunc = new MyAggregateFunction()
tableEnv.registerFunction("aggFunc", aggFunc);
table.groupBy("key")
.aggregate("aggFunc(a, b) as (f0, f1, f2)")
.select("key, f0, f1")
AggregatedTable aggregate(Expression aggregateFunction)
aggregate(Expression)
with a select statement. The output will be flattened if the
output type is a composite type.
Scala Example:
val aggFunc = new MyAggregateFunction
table.groupBy('key)
.aggregate(aggFunc('a, 'b) as ('f0, 'f1, 'f2))
.select('key, 'f0, 'f1)
FlatAggregateTable flatAggregate(String tableAggFunction)
Example:
val tableAggFunc: TableAggregateFunction = new MyTableAggregateFunction
tableEnv.registerFunction("tableAggFunc", tableAggFunc);
tab.groupBy("key")
.flatAggregate("tableAggFunc(a, b) as (x, y, z)")
.select("key, x, y, z")
FlatAggregateTable flatAggregate(Expression tableAggFunction)
Scala Example:
val tableAggFunc: TableAggregateFunction = new MyTableAggregateFunction
tab.groupBy('key)
.flatAggregate(tableAggFunc('a, 'b) as ('x, 'y, 'z))
.select('key, 'x, 'y, 'z)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.