@PublicEvolving public interface FlatAggregateTable
Modifier and Type | Method and Description |
---|---|
Table |
select(Expression... fields)
Performs a selection operation on a FlatAggregateTable table.
|
Table |
select(String fields)
Deprecated.
|
@Deprecated Table select(String fields)
select(Expression...)
Note: You have to close the flatAggregate with a select statement. And the select statement does not support aggregate functions.
Example:
TableAggregateFunction tableAggFunc = new MyTableAggregateFunction();
tableEnv.registerFunction("tableAggFunc", tableAggFunc);
tab.groupBy("key")
.flatAggregate("tableAggFunc(a, b) as (x, y, z)")
.select("key, x, y, z")
Table select(Expression... fields)
Note: You have to close the flatAggregate with a select statement. And the select statement does not support aggregate functions.
Example:
TableAggregateFunction tableAggFunc = new MyTableAggregateFunction();
tableEnv.registerFunction("tableAggFunc", tableAggFunc);
tab.groupBy($("key"))
.flatAggregate(call("tableAggFunc", $("a"), $("b")).as("x", "y", "z"))
.select($("key"), $("x"), $("y"), $("z"));
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–2023 The Apache Software Foundation. All rights reserved.