Package org.apache.calcite.rel.core
Class AggregateCall
java.lang.Object
org.apache.calcite.rel.core.AggregateCall
Call to an aggregate function within an
 
Aggregate.- 
Field SummaryFieldsModifier and TypeFieldDescriptionfinal RelCollationfinal @Nullable ImmutableBitSetfinal intfinal @Nullable Stringfinal RelDataType
- 
Constructor SummaryConstructorsConstructorDescriptionAggregateCall(SqlAggFunction aggFunction, boolean distinct, List<Integer> argList, RelDataType type, String name) Deprecated.
- 
Method SummaryModifier and TypeMethodDescriptionadaptTo(RelNode input, List<Integer> argList, int filterArg, int oldGroupKeyCount, int newGroupKeyCount) Creates an equivalent AggregateCall that is adapted to a new input types and/or number of columns in GROUP BY.Deprecated.Deprecated.copy(List<Integer> argList, int filterArg, RelCollation collation) Deprecated.copy(List<Integer> argList, int filterArg, @Nullable ImmutableBitSet distinctKeys, RelCollation collation) Deprecated.static AggregateCallcreate(SqlParserPos pos, SqlAggFunction aggFunction, boolean distinct, boolean approximate, boolean ignoreNulls, List<RexNode> rexList, List<Integer> argList, int filterArg, @Nullable ImmutableBitSet distinctKeys, RelCollation collation, int groupCount, RelNode input, @Nullable RelDataType type, @Nullable String name) static AggregateCallcreate(SqlParserPos pos, SqlAggFunction aggFunction, boolean distinct, boolean approximate, boolean ignoreNulls, List<RexNode> rexList, List<Integer> argList, int filterArg, @Nullable ImmutableBitSet distinctKeys, RelCollation collation, RelDataType type, @Nullable String name) static AggregateCallcreate(SqlAggFunction aggFunction, boolean distinct, boolean approximate, boolean ignoreNulls, List<Integer> argList, int filterArg, RelCollation collation, RelDataType type, @Nullable String name) Deprecated.static AggregateCallcreate(SqlAggFunction aggFunction, boolean distinct, boolean approximate, boolean ignoreNulls, List<Integer> argList, int filterArg, @Nullable ImmutableBitSet distinctKeys, RelCollation collation, int groupCount, RelNode input, @Nullable RelDataType type, @Nullable String name) Deprecated.static AggregateCallcreate(SqlAggFunction aggFunction, boolean distinct, boolean approximate, boolean ignoreNulls, List<RexNode> rexList, List<Integer> argList, int filterArg, @Nullable ImmutableBitSet distinctKeys, RelCollation collation, int groupCount, RelNode input, @Nullable RelDataType type, @Nullable String name) Creates an AggregateCall, inferring its type iftypeis null.static AggregateCallcreate(SqlAggFunction aggFunction, boolean distinct, boolean approximate, boolean ignoreNulls, List<RexNode> rexList, List<Integer> argList, int filterArg, @Nullable ImmutableBitSet distinctKeys, RelCollation collation, RelDataType type, @Nullable String name) Creates an AggregateCall.static AggregateCallcreate(SqlAggFunction aggFunction, boolean distinct, boolean approximate, List<Integer> argList, int filterArg, int groupCount, RelNode input, @Nullable RelDataType type, @Nullable String name) Deprecated.static AggregateCallcreate(SqlAggFunction aggFunction, boolean distinct, boolean approximate, List<Integer> argList, int filterArg, RelCollation collation, int groupCount, RelNode input, @Nullable RelDataType type, @Nullable String name) Deprecated.static AggregateCallcreate(SqlAggFunction aggFunction, boolean distinct, boolean approximate, List<Integer> argList, int filterArg, RelCollation collation, RelDataType type, @Nullable String name) Deprecated.static AggregateCallcreate(SqlAggFunction aggFunction, boolean distinct, boolean approximate, List<Integer> argList, int filterArg, RelDataType type, @Nullable String name) Deprecated.static AggregateCallcreate(SqlAggFunction aggFunction, boolean distinct, List<Integer> argList, int filterArg, int groupCount, RelNode input, @Nullable RelDataType type, @Nullable String name) Deprecated.static AggregateCallcreate(SqlAggFunction aggFunction, boolean distinct, List<Integer> argList, int groupCount, RelNode input, @Nullable RelDataType type, @Nullable String name) Deprecated.static AggregateCallcreate(SqlAggFunction aggFunction, boolean distinct, List<Integer> argList, int filterArg, RelDataType type, @Nullable String name) Deprecated.createBinding(Aggregate aggregateRelBase) Creates a binding of this call in the context of anLogicalAggregate, which can then be used to infer the return type.booleanfinal SqlAggFunctionReturns the aggregate function.Returns the ordinals of the arguments to this call.Returns the aggregate ordering definition (theWITHIN GROUPclause in SQL), or the empty list if not specified.@Nullable StringgetName()Returns the name.final RelDataTypegetType()Returns the result type.booleanReturns true if this AggregateCall has a non-empty collation.booleanReturns whether this AggregateCall has a filter argument.inthashCode()final booleanReturns whether this AggregateCall ignores nulls.final booleanReturns whether this AggregateCall is approximate, as inAPPROX_COUNT_DISTINCT(empno).final booleanReturns whether this AggregateCall is distinct, as inCOUNT(DISTINCT empno).Deprecated.toString()transform(Mappings.TargetMapping mapping) Creates a copy of this aggregate call, applying a mapping to its arguments.withApproximate(boolean approximate) WithsisApproximate().withArgList(List<Integer> argList) WithsgetArgList().withCollation(RelCollation collation) WithsgetCollation().withDistinct(boolean distinct) WithsisDistinct().withDistinctKeys(@Nullable ImmutableBitSet distinctKeys) WithsdistinctKeys.withFilter(int filterArg) WithsfilterArg.withIgnoreNulls(boolean ignoreNulls) WithsignoreNulls().Withsname.
- 
Field Details- 
type
- 
name
- 
rexList
- 
filterArgpublic final int filterArg
- 
distinctKeys
- 
collation
 
- 
- 
Constructor Details- 
AggregateCall@Deprecated public AggregateCall(SqlAggFunction aggFunction, boolean distinct, List<Integer> argList, RelDataType type, String name) Deprecated.Creates an AggregateCall.- Parameters:
- aggFunction- Aggregate function
- distinct- Whether distinct
- argList- List of ordinals of arguments
- type- Result type
- name- Name (may be null)
 
 
- 
- 
Method Details- 
create@Deprecated public static AggregateCall create(SqlAggFunction aggFunction, boolean distinct, List<Integer> argList, int groupCount, RelNode input, @Nullable RelDataType type, @Nullable String name) Deprecated.
- 
create@Deprecated public static AggregateCall create(SqlAggFunction aggFunction, boolean distinct, List<Integer> argList, int filterArg, int groupCount, RelNode input, @Nullable RelDataType type, @Nullable String name) Deprecated.
- 
create@Deprecated public static AggregateCall create(SqlAggFunction aggFunction, boolean distinct, boolean approximate, List<Integer> argList, int filterArg, int groupCount, RelNode input, @Nullable RelDataType type, @Nullable String name) Deprecated.
- 
create@Deprecated public static AggregateCall create(SqlAggFunction aggFunction, boolean distinct, boolean approximate, List<Integer> argList, int filterArg, RelCollation collation, int groupCount, RelNode input, @Nullable RelDataType type, @Nullable String name) Deprecated.
- 
create@Deprecated public static AggregateCall create(SqlAggFunction aggFunction, boolean distinct, boolean approximate, boolean ignoreNulls, List<Integer> argList, int filterArg, @Nullable ImmutableBitSet distinctKeys, RelCollation collation, int groupCount, RelNode input, @Nullable RelDataType type, @Nullable String name) Deprecated.
- 
createpublic static AggregateCall create(SqlAggFunction aggFunction, boolean distinct, boolean approximate, boolean ignoreNulls, List<RexNode> rexList, List<Integer> argList, int filterArg, @Nullable ImmutableBitSet distinctKeys, RelCollation collation, int groupCount, RelNode input, @Nullable RelDataType type, @Nullable String name) Creates an AggregateCall, inferring its type iftypeis null.
- 
createpublic static AggregateCall create(SqlParserPos pos, SqlAggFunction aggFunction, boolean distinct, boolean approximate, boolean ignoreNulls, List<RexNode> rexList, List<Integer> argList, int filterArg, @Nullable ImmutableBitSet distinctKeys, RelCollation collation, int groupCount, RelNode input, @Nullable RelDataType type, @Nullable String name) 
- 
create@Deprecated public static AggregateCall create(SqlAggFunction aggFunction, boolean distinct, List<Integer> argList, int filterArg, RelDataType type, @Nullable String name) Deprecated.
- 
create@Deprecated public static AggregateCall create(SqlAggFunction aggFunction, boolean distinct, boolean approximate, List<Integer> argList, int filterArg, RelDataType type, @Nullable String name) Deprecated.
- 
create@Deprecated public static AggregateCall create(SqlAggFunction aggFunction, boolean distinct, boolean approximate, List<Integer> argList, int filterArg, RelCollation collation, RelDataType type, @Nullable String name) Deprecated.
- 
create@Deprecated public static AggregateCall create(SqlAggFunction aggFunction, boolean distinct, boolean approximate, boolean ignoreNulls, List<Integer> argList, int filterArg, RelCollation collation, RelDataType type, @Nullable String name) Deprecated.
- 
createpublic static AggregateCall create(SqlAggFunction aggFunction, boolean distinct, boolean approximate, boolean ignoreNulls, List<RexNode> rexList, List<Integer> argList, int filterArg, @Nullable ImmutableBitSet distinctKeys, RelCollation collation, RelDataType type, @Nullable String name) Creates an AggregateCall.
- 
createpublic static AggregateCall create(SqlParserPos pos, SqlAggFunction aggFunction, boolean distinct, boolean approximate, boolean ignoreNulls, List<RexNode> rexList, List<Integer> argList, int filterArg, @Nullable ImmutableBitSet distinctKeys, RelCollation collation, RelDataType type, @Nullable String name) 
- 
isDistinctpublic final boolean isDistinct()Returns whether this AggregateCall is distinct, as inCOUNT(DISTINCT empno).- Returns:
- whether distinct
 
- 
withDistinctWithsisDistinct().
- 
isApproximatepublic final boolean isApproximate()Returns whether this AggregateCall is approximate, as inAPPROX_COUNT_DISTINCT(empno).- Returns:
- whether approximate
 
- 
withApproximateWithsisApproximate().
- 
ignoreNullspublic final boolean ignoreNulls()Returns whether this AggregateCall ignores nulls.- Returns:
- whether ignore nulls
 
- 
withIgnoreNullsWithsignoreNulls().
- 
getAggregationReturns the aggregate function.- Returns:
- aggregate function
 
- 
getCollationReturns the aggregate ordering definition (theWITHIN GROUPclause in SQL), or the empty list if not specified.- Returns:
- ordering definition
 
- 
withCollationWithsgetCollation().
- 
getArgListReturns the ordinals of the arguments to this call.The list is immutable. - Returns:
- list of argument ordinals
 
- 
withArgListWithsgetArgList().
- 
withDistinctKeysWithsdistinctKeys.
- 
getTypeReturns the result type.- Returns:
- result type
 
- 
getNameReturns the name.- Returns:
- name
 
- 
withNameWithsname.
- 
renameDeprecated.
- 
toString
- 
hasFilterpublic boolean hasFilter()Returns whether this AggregateCall has a filter argument.
- 
hasCollationpublic boolean hasCollation()Returns true if this AggregateCall has a non-empty collation. Returns false otherwise.
- 
withFilterWithsfilterArg.
- 
getParserPosition
- 
equals
- 
hashCodepublic int hashCode()
- 
createBindingCreates a binding of this call in the context of anLogicalAggregate, which can then be used to infer the return type.
- 
copy@Deprecated public AggregateCall copy(List<Integer> argList, int filterArg, @Nullable ImmutableBitSet distinctKeys, RelCollation collation) Deprecated.Creates an equivalent AggregateCall with new argument ordinals.- Parameters:
- argList- Arguments
- Returns:
- AggregateCall that suits new inputs and GROUP BY columns
- See Also:
 
- 
copyDeprecated.
- 
copyDeprecated.
- 
copyDeprecated.
- 
adaptTopublic AggregateCall adaptTo(RelNode input, List<Integer> argList, int filterArg, int oldGroupKeyCount, int newGroupKeyCount) Creates an equivalent AggregateCall that is adapted to a new input types and/or number of columns in GROUP BY.- Parameters:
- input- Relation that will be input of Aggregate
- argList- Argument indices of the new call in the input
- filterArg- Index of the filter, or -1
- oldGroupKeyCount- number of columns in GROUP BY of old aggregate
- newGroupKeyCount- number of columns in GROUP BY of new aggregate
- Returns:
- AggregateCall that suits new inputs and GROUP BY columns
 
- 
transformCreates a copy of this aggregate call, applying a mapping to its arguments.
 
-