Interface FlatAggregateTable


@PublicEvolving public interface FlatAggregateTable
A table that performs flatAggregate on a Table, a GroupedTable or a WindowGroupedTable.
  • Method Summary

    Modifier and Type
    Method
    Description
    select(org.apache.flink.table.expressions.Expression... fields)
    Performs a selection operation on a FlatAggregateTable table.
  • Method Details

    • select

      Table select(org.apache.flink.table.expressions.Expression... fields)
      Performs a selection operation on a FlatAggregateTable table. Similar to a SQL SELECT statement. The field expressions can contain complex expressions.

      Note: You have to close the flatAggregate with a select statement. And the select statement does not support aggregate functions.

      Example:

      
       tableEnv.createTemporarySystemFunction("tableAggFunc", MyTableAggregateFunction.class);
       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")