Class SqlOracleConvertFunction
It has a slight different semantics to standard SQL's
SqlStdOperatorTable.CONVERT function on operands' order, and default
charset will be used if the srcCharsetName is not specified.
Returns null if charValue is null or empty.
-
Field Summary
Fields inherited from class org.apache.calcite.sql.SqlOperator
kind, MDX_PRECEDENCE, NL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionderiveType(SqlValidator validator, SqlValidatorScope scope, SqlCall call) Derives the type of a call to this operator.Returns a constraint on the number of operands expected by this operator.getSignatureTemplate(int operandsCount) Returns a template describing how the operator signature is to be built.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.voidvalidateCall(SqlCall call, SqlValidator validator, SqlValidatorScope scope, SqlValidatorScope operandScope) Validates a call to this operator.Methods inherited from class org.apache.calcite.sql.fun.SqlConvertFunction
acceptCall, checkOperandTypes, unparseMethods inherited from class org.apache.calcite.sql.SqlFunction
getFunctionType, getNameAsId, getParamNames, getParamTypes, getSqlIdentifier, getSyntax, isQuantifierAllowed, validateQuantifierMethods inherited from class org.apache.calcite.sql.SqlOperator
acceptCall, adjustType, allowsFraming, argumentMustBeScalar, checkOperandCount, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, createCall, createCall, createCall, deriveOperandType, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getMonotonicity, getName, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getSqlCallFactory, getStrongPolicyInference, hashCode, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, isSymmetrical, leftPrec, not, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, reverse, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateOperands, validRexOperands
-
Constructor Details
-
SqlOracleConvertFunction
-
-
Method Details
-
validateCall
public void validateCall(SqlCall call, SqlValidator validator, SqlValidatorScope scope, SqlValidatorScope operandScope) Description copied from class:SqlOperatorValidates 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 ofSqlCallnever call this method.- Overrides:
validateCallin classSqlConvertFunction- 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:
-
inferReturnType
Description copied from class:SqlOperatorInfers 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 ofSqlReturnTypeInferenceto the constructor.- Overrides:
inferReturnTypein classSqlConvertFunction- Parameters:
opBinding- description of invocation (not necessarily aSqlCall)- Returns:
- inferred return type
-
deriveType
Description copied from class:SqlOperatorDerives the type of a call to this operator.This method is an intrinsic part of the validation process so, unlike
SqlOperator.inferReturnType(org.apache.calcite.sql.SqlOperatorBinding), specific operators would not typically override this method.- Overrides:
deriveTypein classSqlConvertFunction- Parameters:
validator- Validatorscope- Scope of validationcall- Call to this operator- Returns:
- Type of call
-
getSignatureTemplate
Description copied from class:SqlOperatorReturns a template describing how the operator signature is to be built. E.g for the binary + operator the template looks like "{1} {0} {2}" {0} is the operator, subsequent numbers are operands.- Overrides:
getSignatureTemplatein classSqlConvertFunction- Parameters:
operandsCount- is used with functions that can take a variable number of operands- Returns:
- signature template, or null to indicate that a default template will suffice
-
getOperandCountRange
Description copied from class:SqlOperatorReturns a constraint on the number of operands expected by this operator. Subclasses may override this method; when they don't, the range is derived from theSqlOperandTypeCheckerassociated with this operator.- Overrides:
getOperandCountRangein classSqlConvertFunction- Returns:
- acceptable range
-