Package org.apache.calcite.sql.fun
Class SqlAbstractGroupFunction
- java.lang.Object
-
- org.apache.calcite.sql.SqlOperator
-
- org.apache.calcite.sql.SqlFunction
-
- org.apache.calcite.sql.SqlAggFunction
-
- org.apache.calcite.sql.fun.SqlAbstractGroupFunction
-
- Direct Known Subclasses:
SqlGroupIdFunction
,SqlGroupingFunction
,SqlGroupingIdFunction
public class SqlAbstractGroupFunction extends SqlAggFunction
Base class for grouping functionsGROUP_ID
,GROUPING_ID
,GROUPING
.
-
-
Field Summary
-
Fields inherited from class org.apache.calcite.sql.SqlOperator
kind, MDX_PRECEDENCE, NL
-
-
Constructor Summary
Constructors Constructor Description SqlAbstractGroupFunction(java.lang.String name, SqlKind kind, SqlReturnTypeInference returnTypeInference, SqlOperandTypeInference operandTypeInference, SqlOperandTypeChecker operandTypeChecker, SqlFunctionCategory category)
Creates a SqlAbstractGroupFunction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allowsFilter()
Whether this aggregate function allows aFILTER (WHERE ...)
clause.boolean
isQuantifierAllowed()
Returns whether this function allows aDISTINCT
orALL
quantifier.void
validateCall(SqlCall call, SqlValidator validator, SqlValidatorScope scope, SqlValidatorScope operandScope)
Validates a call to this operator.-
Methods inherited from class org.apache.calcite.sql.SqlAggFunction
getParameterTypes, getReturnType, isAggregator, requiresGroupOrder, requiresOrder, requiresOver, unwrap
-
Methods inherited from class org.apache.calcite.sql.SqlFunction
deriveType, getFunctionType, getNameAsId, getParamNames, getParamTypes, getSqlIdentifier, getSyntax, unparse, validateQuantifier
-
Methods inherited from class org.apache.calcite.sql.SqlOperator
acceptCall, acceptCall, adjustType, allowsFraming, argumentMustBeScalar, checkOperandCount, checkOperandTypes, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getMonotonicity, getName, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getSignatureTemplate, hashCode, inferReturnType, inferReturnType, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, leftPrec, preValidateCall, requiresDecimalExpansion, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateOperands, validRexOperands
-
-
-
-
Constructor Detail
-
SqlAbstractGroupFunction
public SqlAbstractGroupFunction(java.lang.String name, SqlKind kind, SqlReturnTypeInference returnTypeInference, SqlOperandTypeInference operandTypeInference, SqlOperandTypeChecker operandTypeChecker, SqlFunctionCategory category)
Creates a SqlAbstractGroupFunction.- Parameters:
name
- Name of builtin functionkind
- kind of operator implemented by functionreturnTypeInference
- strategy to use for return type inferenceoperandTypeInference
- strategy to use for parameter type inferenceoperandTypeChecker
- strategy to use for parameter type checkingcategory
- categorization for function
-
-
Method Detail
-
validateCall
public void validateCall(SqlCall call, SqlValidator validator, SqlValidatorScope scope, SqlValidatorScope operandScope)
Description copied from class:SqlOperator
Validates a call to this operator.This method should not perform type-derivation or perform validation related related to types. That is done later, by
SqlOperator.deriveType(SqlValidator, SqlValidatorScope, SqlCall)
. This method should focus on structural validation.A typical implementation of this method first validates the operands, then performs some operator-specific logic. The default implementation just validates the operands.
This method is the default implementation of
SqlCall.validate(org.apache.calcite.sql.validate.SqlValidator, org.apache.calcite.sql.validate.SqlValidatorScope)
; but note that some sub-classes ofSqlCall
never call this method.- Overrides:
validateCall
in classSqlAggFunction
- Parameters:
call
- the call to this operatorvalidator
- the active validatorscope
- validator scopeoperandScope
- validator scope in which to validate operands to this call; usually equal to scope, but not always because some operators introduce new scopes- See Also:
SqlNode.validateExpr(SqlValidator, SqlValidatorScope)
,SqlOperator.deriveType(SqlValidator, SqlValidatorScope, SqlCall)
-
isQuantifierAllowed
public boolean isQuantifierAllowed()
Description copied from class:SqlFunction
Returns whether this function allows aDISTINCT
orALL
quantifier. The default isfalse
; some aggregate functions returntrue
.- Overrides:
isQuantifierAllowed
in classSqlAggFunction
-
allowsFilter
public boolean allowsFilter()
Description copied from class:SqlAggFunction
Whether this aggregate function allows aFILTER (WHERE ...)
clause.- Overrides:
allowsFilter
in classSqlAggFunction
-
-