@PublicEvolving public interface AggregatedTable
Modifier and Type | Method and Description |
---|---|
Table |
select(Expression... fields)
Performs a selection operation after an aggregate operation.
|
Table |
select(String fields)
Deprecated.
|
@Deprecated Table select(String fields)
select(Expression...)
Example:
AggregateFunction aggFunc = new MyAggregateFunction();
tableEnv.registerFunction("aggFunc", aggFunc);
table.groupBy("key")
.aggregate("aggFunc(a, b) as (f0, f1, f2)")
.select("key, f0, f1");
Table select(Expression... fields)
Example:
AggregateFunction aggFunc = new MyAggregateFunction();
tableEnv.registerFunction("aggFunc", aggFunc);
table.groupBy($("key"))
.aggregate(call("aggFunc", $("a"), $("b")).as("f0", "f1", "f2"))
.select($("key"), $("f0"), $("f1"));
Scala Example:
val aggFunc = new MyAggregateFunction
table.groupBy($"key")
.aggregate(aggFunc($"a", $"b") as ("f0", "f1", "f2"))
.select($"key", $"f0", $"f1")
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.