public class AggregateUtil extends Object
Constructor and Description |
---|
AggregateUtil() |
Modifier and Type | Method and Description |
---|---|
static RichGroupReduceFunction<Row,Row> |
createAggregateGroupReduceFunction(scala.collection.Seq<org.apache.calcite.util.Pair<org.apache.calcite.rel.core.AggregateCall,String>> namedAggregates,
org.apache.calcite.rel.type.RelDataType inputType,
org.apache.calcite.rel.type.RelDataType outputType,
int[] groupings)
Create a
GroupReduceFunction to compute aggregates. |
static AllWindowFunction<Row,Row,Window> |
createAllWindowAggregationFunction(LogicalWindow window,
scala.collection.Seq<org.apache.calcite.util.Pair<org.apache.calcite.rel.core.AggregateCall,String>> namedAggregates,
org.apache.calcite.rel.type.RelDataType inputType,
org.apache.calcite.rel.type.RelDataType outputType,
int[] groupings,
scala.collection.Seq<FlinkRelBuilder.NamedWindowProperty> properties)
Create an
AllWindowFunction to compute non-partitioned group window aggregates. |
static AllWindowFunction<Row,Row,Window> |
createAllWindowIncrementalAggregationFunction(LogicalWindow window,
scala.collection.Seq<org.apache.calcite.util.Pair<org.apache.calcite.rel.core.AggregateCall,String>> namedAggregates,
org.apache.calcite.rel.type.RelDataType inputType,
org.apache.calcite.rel.type.RelDataType outputType,
int[] groupings,
scala.collection.Seq<FlinkRelBuilder.NamedWindowProperty> properties)
Create an
AllWindowFunction to finalize incrementally pre-computed non-partitioned
window aggreagtes. |
static IncrementalAggregateReduceFunction |
createIncrementalAggregateReduceFunction(scala.collection.Seq<org.apache.calcite.util.Pair<org.apache.calcite.rel.core.AggregateCall,String>> namedAggregates,
org.apache.calcite.rel.type.RelDataType inputType,
org.apache.calcite.rel.type.RelDataType outputType,
int[] groupings)
Create a
ReduceFunction for incremental window
aggregation. |
static MapFunction<Object,Row> |
createPrepareMapFunction(scala.collection.Seq<org.apache.calcite.util.Pair<org.apache.calcite.rel.core.AggregateCall,String>> namedAggregates,
int[] groupings,
org.apache.calcite.rel.type.RelDataType inputType)
Create a
MapFunction that prepares for aggregates. |
static WindowFunction<Row,Row,Tuple,Window> |
createWindowAggregationFunction(LogicalWindow window,
scala.collection.Seq<org.apache.calcite.util.Pair<org.apache.calcite.rel.core.AggregateCall,String>> namedAggregates,
org.apache.calcite.rel.type.RelDataType inputType,
org.apache.calcite.rel.type.RelDataType outputType,
int[] groupings,
scala.collection.Seq<FlinkRelBuilder.NamedWindowProperty> properties)
Create a
WindowFunction to compute partitioned group window aggregates. |
static WindowFunction<Row,Row,Tuple,Window> |
createWindowIncrementalAggregationFunction(LogicalWindow window,
scala.collection.Seq<org.apache.calcite.util.Pair<org.apache.calcite.rel.core.AggregateCall,String>> namedAggregates,
org.apache.calcite.rel.type.RelDataType inputType,
org.apache.calcite.rel.type.RelDataType outputType,
int[] groupings,
scala.collection.Seq<FlinkRelBuilder.NamedWindowProperty> properties)
Create a
WindowFunction to finalize incrementally pre-computed window aggregates. |
static boolean |
doAllSupportPartialAggregation(scala.collection.Seq<org.apache.calcite.rel.core.AggregateCall> aggregateCalls,
org.apache.calcite.rel.type.RelDataType inputType,
int groupKeysCount)
Return true if all aggregates can be partially computed.
|
public static MapFunction<Object,Row> createPrepareMapFunction(scala.collection.Seq<org.apache.calcite.util.Pair<org.apache.calcite.rel.core.AggregateCall,String>> namedAggregates, int[] groupings, org.apache.calcite.rel.type.RelDataType inputType)
MapFunction
that prepares for aggregates.
The function returns intermediate aggregate values of all aggregate function which are
organized by the following format:
avg(x) aggOffsetInRow = 2 count(z) aggOffsetInRow = 5
| |
v v
+---------+---------+--------+--------+--------+--------+
|groupKey1|groupKey2| sum1 | count1 | sum2 | count2 |
+---------+---------+--------+--------+--------+--------+
^
|
sum(y) aggOffsetInRow = 4
public static RichGroupReduceFunction<Row,Row> createAggregateGroupReduceFunction(scala.collection.Seq<org.apache.calcite.util.Pair<org.apache.calcite.rel.core.AggregateCall,String>> namedAggregates, org.apache.calcite.rel.type.RelDataType inputType, org.apache.calcite.rel.type.RelDataType outputType, int[] groupings)
GroupReduceFunction
to compute aggregates.
If all aggregates support partial aggregation, the
GroupReduceFunction
implements
CombineFunction
as well.
public static IncrementalAggregateReduceFunction createIncrementalAggregateReduceFunction(scala.collection.Seq<org.apache.calcite.util.Pair<org.apache.calcite.rel.core.AggregateCall,String>> namedAggregates, org.apache.calcite.rel.type.RelDataType inputType, org.apache.calcite.rel.type.RelDataType outputType, int[] groupings)
ReduceFunction
for incremental window
aggregation.
public static AllWindowFunction<Row,Row,Window> createAllWindowAggregationFunction(LogicalWindow window, scala.collection.Seq<org.apache.calcite.util.Pair<org.apache.calcite.rel.core.AggregateCall,String>> namedAggregates, org.apache.calcite.rel.type.RelDataType inputType, org.apache.calcite.rel.type.RelDataType outputType, int[] groupings, scala.collection.Seq<FlinkRelBuilder.NamedWindowProperty> properties)
AllWindowFunction
to compute non-partitioned group window aggregates.public static WindowFunction<Row,Row,Tuple,Window> createWindowAggregationFunction(LogicalWindow window, scala.collection.Seq<org.apache.calcite.util.Pair<org.apache.calcite.rel.core.AggregateCall,String>> namedAggregates, org.apache.calcite.rel.type.RelDataType inputType, org.apache.calcite.rel.type.RelDataType outputType, int[] groupings, scala.collection.Seq<FlinkRelBuilder.NamedWindowProperty> properties)
WindowFunction
to compute partitioned group window aggregates.
public static AllWindowFunction<Row,Row,Window> createAllWindowIncrementalAggregationFunction(LogicalWindow window, scala.collection.Seq<org.apache.calcite.util.Pair<org.apache.calcite.rel.core.AggregateCall,String>> namedAggregates, org.apache.calcite.rel.type.RelDataType inputType, org.apache.calcite.rel.type.RelDataType outputType, int[] groupings, scala.collection.Seq<FlinkRelBuilder.NamedWindowProperty> properties)
AllWindowFunction
to finalize incrementally pre-computed non-partitioned
window aggreagtes.public static WindowFunction<Row,Row,Tuple,Window> createWindowIncrementalAggregationFunction(LogicalWindow window, scala.collection.Seq<org.apache.calcite.util.Pair<org.apache.calcite.rel.core.AggregateCall,String>> namedAggregates, org.apache.calcite.rel.type.RelDataType inputType, org.apache.calcite.rel.type.RelDataType outputType, int[] groupings, scala.collection.Seq<FlinkRelBuilder.NamedWindowProperty> properties)
WindowFunction
to finalize incrementally pre-computed window aggregates.public static boolean doAllSupportPartialAggregation(scala.collection.Seq<org.apache.calcite.rel.core.AggregateCall> aggregateCalls, org.apache.calcite.rel.type.RelDataType inputType, int groupKeysCount)
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.