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
Base class for grouping functions
GROUP_ID
, GROUPING_ID
,
GROUPING
.-
Field Summary
Fields inherited from class org.apache.calcite.sql.SqlOperator
kind, MDX_PRECEDENCE, NL
-
Constructor Summary
ConstructorDescriptionSqlAbstractGroupFunction
(String name, SqlKind kind, SqlReturnTypeInference returnTypeInference, @Nullable SqlOperandTypeInference operandTypeInference, SqlOperandTypeChecker operandTypeChecker, SqlFunctionCategory category) Creates a SqlAbstractGroupFunction. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Whether this aggregate function allows aFILTER (WHERE ...)
clause.boolean
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
allowsNullTreatment, getDistinctOptionality, getParameterTypes, getReturnType, getRollup, isAggregator, isPercentile, 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, createCall, createCall, createCall, deriveOperandType, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getMonotonicity, getName, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getSignatureTemplate, getStrongPolicyInference, hashCode, inferReturnType, inferReturnType, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, isSymmetrical, leftPrec, not, preValidateCall, requiresDecimalExpansion, reverse, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateOperands, validRexOperands
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.calcite.schema.Wrapper
maybeUnwrap, unwrapOrThrow
-
Constructor Details
-
SqlAbstractGroupFunction
public SqlAbstractGroupFunction(String name, SqlKind kind, SqlReturnTypeInference returnTypeInference, @Nullable 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 Details
-
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:
-
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
-