Package org.apache.calcite.sql.fun
Class SqlCoalesceFunction
java.lang.Object
org.apache.calcite.sql.SqlOperator
org.apache.calcite.sql.SqlFunction
org.apache.calcite.sql.fun.SqlCoalesceFunction
The
COALESCE
function.-
Field Summary
Fields inherited from class org.apache.calcite.sql.SqlOperator
kind, MDX_PRECEDENCE, NL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the return type inference strategy for this operator, or null if return type inference is implemented by a subclass override.@NonNull RelDataType
inferReturnType
(SqlOperatorBinding opBinding) Infers the return type of an invocation of this operator; only called after the number and types of operands have already been validated.rewriteCall
(SqlValidator validator, SqlCall call) Rewrites a call to this operator.Methods inherited from class org.apache.calcite.sql.SqlFunction
deriveType, getFunctionType, getNameAsId, getParamNames, getParamTypes, getSqlIdentifier, getSyntax, isQuantifierAllowed, unparse, validateCall, 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, getRightPrec, getSignatureTemplate, getSqlCallFactory, getStrongPolicyInference, hashCode, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, isSymmetrical, leftPrec, not, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, reverse, rightPrec, toString, unparseListClause, unparseListClause, validateOperands, validRexOperands
-
Constructor Details
-
SqlCoalesceFunction
public SqlCoalesceFunction()
-
-
Method Details
-
rewriteCall
Description copied from class:SqlOperator
Rewrites a call to this operator. Some operators are implemented as trivial rewrites (e.g. NULLIF becomes CASE). However, we don't do this at createCall time because we want to preserve the original SQL syntax as much as possible; instead, we do this before the call is validated (so the trivial operator doesn't need its own implementation of type derivation methods). The default implementation is to just return the original call without any rewrite.- Overrides:
rewriteCall
in classSqlOperator
- Parameters:
validator
- Validatorcall
- Call to be rewritten- Returns:
- rewritten call
-
inferReturnType
Description copied from class:SqlOperator
Infers the return type of an invocation of this operator; only called after the number and types of operands have already been validated. Subclasses must either override this method or supply an instance ofSqlReturnTypeInference
to the constructor.- Overrides:
inferReturnType
in classSqlOperator
- Parameters:
opBinding
- description of invocation (not necessarily aSqlCall
)- Returns:
- inferred return type
-
getReturnTypeInference
Description copied from class:SqlOperator
Returns the return type inference strategy for this operator, or null if return type inference is implemented by a subclass override.- Overrides:
getReturnTypeInference
in classSqlOperator
-