Package org.apache.calcite.rel.core
Class Aggregate.AggCallBinding
java.lang.Object
org.apache.calcite.sql.SqlOperatorBinding
org.apache.calcite.rel.core.Aggregate.AggCallBinding
- Direct Known Subclasses:
Aggregate.PercentileDiscAggCallBinding
- Enclosing class:
Aggregate
Implementation of the
SqlOperatorBinding interface for an
aggregate call applied to a set of operands in the
context of a LogicalAggregate.-
Field Summary
Fields inherited from class org.apache.calcite.sql.SqlOperatorBinding
typeFactory -
Constructor Summary
ConstructorsConstructorDescriptionAggCallBinding(RelDataTypeFactory typeFactory, SqlAggFunction aggFunction, List<RelDataType> operands, int groupCount, boolean filter) Deprecated.AggCallBinding(RelDataTypeFactory typeFactory, SqlAggFunction aggFunction, List<RelDataType> preOperands, List<RelDataType> operands, boolean hasEmptyGroup, boolean filter) Creates an AggCallBinding.AggCallBinding(RelDataTypeFactory typeFactory, SqlAggFunction aggFunction, List<RelDataType> preOperands, List<RelDataType> operands, int groupCount, boolean filter) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionintDeprecated.intReturns the number of bound operands.getOperandType(int ordinal) Gets the type of a bound operand.intReturns the number of pre-operands.booleanIf the operator call occurs in an aggregate query, returns whether there are empty groups in the GROUP BY clause.booleanReturns whether the operator is an aggregate function with a filter.newError(org.apache.calcite.runtime.Resources.ExInst<SqlValidatorException> e) Wraps a validation error with context appropriate to this operator call.Methods inherited from class org.apache.calcite.sql.SqlOperatorBinding
collectOperandTypes, getCollationType, getColumnListParamInfo, getCursorOperand, getIntLiteralOperand, getOperandLiteralValue, getOperandLiteralValue, getOperandLiteralValue, getOperandMonotonicity, getOperator, getStringLiteralOperand, getTypeFactory, isOperandLiteral, isOperandNull, isOperandTimeFrame, transform
-
Constructor Details
-
AggCallBinding
@Deprecated public AggCallBinding(RelDataTypeFactory typeFactory, SqlAggFunction aggFunction, List<RelDataType> preOperands, List<RelDataType> operands, int groupCount, boolean filter) Creates an AggCallBinding.- Parameters:
typeFactory- Type factoryaggFunction- Aggregate functionpreOperands- Data types of pre-operandsoperands- Data types of operandsgroupCount- Number of columns in the GROUP BY clausefilter- Whether the aggregate function has a FILTER clause
-
AggCallBinding
public AggCallBinding(RelDataTypeFactory typeFactory, SqlAggFunction aggFunction, List<RelDataType> preOperands, List<RelDataType> operands, boolean hasEmptyGroup, boolean filter) Creates an AggCallBinding.- Parameters:
typeFactory- Type factoryaggFunction- Aggregate functionpreOperands- Data types of pre-operandsoperands- Data types of operandshasEmptyGroup- Whether the aggregate has a empty groupfilter- Whether the aggregate function has a FILTER clause
-
AggCallBinding
@Deprecated public AggCallBinding(RelDataTypeFactory typeFactory, SqlAggFunction aggFunction, List<RelDataType> operands, int groupCount, boolean filter) Deprecated.
-
-
Method Details
-
getGroupCount
Deprecated.Description copied from class:SqlOperatorBindingIf the operator call occurs in an aggregate query, returns the number of columns in the GROUP BY clause. For example, for "SELECT count(*) FROM emp GROUP BY deptno, gender", returns 2.Returns 0 if the query is implicitly "GROUP BY ()" because of an aggregate expression. For example, "SELECT sum(sal) FROM emp".
Returns -1 if the query is not an aggregate query.
- Overrides:
getGroupCountin classSqlOperatorBinding
-
hasEmptyGroup
public boolean hasEmptyGroup()Description copied from class:SqlOperatorBindingIf the operator call occurs in an aggregate query, returns whether there are empty groups in the GROUP BY clause. For example,SELECT count(*) FROM emp GROUP BY deptno, gender; returns false SELECT count(*) FROM emp; returns true SELECT count(*) FROM emp GROUP BY ROLLUP(deptno, gender); returns true
Returns false if the query is not an aggregate query.- Overrides:
hasEmptyGroupin classSqlOperatorBinding
-
hasFilter
public boolean hasFilter()Description copied from class:SqlOperatorBindingReturns whether the operator is an aggregate function with a filter.- Overrides:
hasFilterin classSqlOperatorBinding
-
getPreOperandCount
public int getPreOperandCount()Description copied from class:SqlOperatorBindingReturns the number of pre-operands. Zero except for a few aggregate functions.- Overrides:
getPreOperandCountin classSqlOperatorBinding
-
getOperandCount
public int getOperandCount()Description copied from class:SqlOperatorBindingReturns the number of bound operands. Includes pre-operands and regular operands.- Specified by:
getOperandCountin classSqlOperatorBinding
-
getOperandType
Description copied from class:SqlOperatorBindingGets the type of a bound operand.- Specified by:
getOperandTypein classSqlOperatorBinding- Parameters:
ordinal- zero-based ordinal of operand of interest- Returns:
- bound operand type
-
newError
public CalciteException newError(org.apache.calcite.runtime.Resources.ExInst<SqlValidatorException> e) Description copied from class:SqlOperatorBindingWraps a validation error with context appropriate to this operator call.- Specified by:
newErrorin classSqlOperatorBinding- Parameters:
e- Validation error, not null- Returns:
- Error wrapped, if possible, with positional information
-
AggCallBinding(RelDataTypeFactory, SqlAggFunction, List, List, boolean, boolean)