Package org.apache.calcite.sql
Class SqlSplittableAggFunction.Sum0Splitter
java.lang.Object
org.apache.calcite.sql.SqlSplittableAggFunction.AbstractSumSplitter
org.apache.calcite.sql.SqlSplittableAggFunction.Sum0Splitter
- All Implemented Interfaces:
SqlSingletonAggFunction
,SqlSplittableAggFunction
- Enclosing interface:
SqlSplittableAggFunction
public static class SqlSplittableAggFunction.Sum0Splitter
extends SqlSplittableAggFunction.AbstractSumSplitter
Splitting strategy for
SUM0
function.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.sql.SqlSplittableAggFunction
SqlSplittableAggFunction.AbstractSumSplitter, SqlSplittableAggFunction.CountSplitter, SqlSplittableAggFunction.Registry<E>, SqlSplittableAggFunction.SelfSplitter, SqlSplittableAggFunction.Sum0Splitter, SqlSplittableAggFunction.SumSplitter
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionsingleton
(RexBuilder rexBuilder, RelDataType inputRowType, AggregateCall aggregateCall) Generates an expression for the value of the aggregate function when applied to a single row.Methods inherited from class org.apache.calcite.sql.SqlSplittableAggFunction.AbstractSumSplitter
merge, other, split, topSplit
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
Sum0Splitter
public Sum0Splitter()
-
-
Method Details
-
getMergeAggFunctionOfTopSplit
- Specified by:
getMergeAggFunctionOfTopSplit
in classSqlSplittableAggFunction.AbstractSumSplitter
-
singleton
public RexNode singleton(RexBuilder rexBuilder, RelDataType inputRowType, AggregateCall aggregateCall) Description copied from interface:SqlSingletonAggFunction
Generates an expression for the value of the aggregate function when applied to a single row.For example, if there is one row:
SUM(x)
isx
MIN(x)
isx
MAX(x)
isx
COUNT(x)
isCASE WHEN x IS NOT NULL THEN 1 ELSE 0 END 1
which can be simplified to1
ifx
is never nullCOUNT(*)
is 1GROUPING(deptno)
if 0 ifdeptno
is being grouped, 1 otherwise
- Specified by:
singleton
in interfaceSqlSingletonAggFunction
- Overrides:
singleton
in classSqlSplittableAggFunction.AbstractSumSplitter
- Parameters:
rexBuilder
- Rex builderinputRowType
- Input row typeaggregateCall
- Aggregate call- Returns:
- Expression for single row
-