public class SqlCastFunction
extends org.apache.calcite.sql.SqlFunction
Can be used for both SqlCall
and RexCall
. Note that the
SqlCall
has two operands (expression and type), while the RexCall
has one operand
(expression) and the type is obtained from RexNode.getType()
.
The class was copied over because of CALCITE-5017, in order to workaround the method SqlTypeUtil.canCastFrom(RelDataType, RelDataType, boolean)
. Line 141 in checkOperandTypes(SqlCallBinding, boolean)
and new method canCastFrom(RelDataType,
RelDataType)
.
SqlCastOperator
Constructor and Description |
---|
SqlCastFunction() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkOperandTypes(org.apache.calcite.sql.SqlCallBinding callBinding,
boolean throwOnFailure)
Makes sure that the number and types of arguments are allowable.
|
org.apache.calcite.sql.validate.SqlMonotonicity |
getMonotonicity(org.apache.calcite.sql.SqlOperatorBinding call) |
org.apache.calcite.sql.SqlOperandCountRange |
getOperandCountRange() |
String |
getSignatureTemplate(int operandsCount) |
org.apache.calcite.sql.SqlSyntax |
getSyntax() |
org.apache.calcite.rel.type.RelDataType |
inferReturnType(org.apache.calcite.sql.SqlOperatorBinding opBinding) |
void |
unparse(org.apache.calcite.sql.SqlWriter writer,
org.apache.calcite.sql.SqlCall call,
int leftPrec,
int rightPrec) |
deriveType, getFunctionType, getNameAsId, getParamNames, getParamTypes, getSqlIdentifier, isQuantifierAllowed, validateCall, validateQuantifier
acceptCall, acceptCall, adjustType, allowsFraming, argumentMustBeScalar, checkOperandCount, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getName, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getStrongPolicyInference, hashCode, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, isSymmetrical, leftPrec, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateOperands, validRexOperands
public org.apache.calcite.rel.type.RelDataType inferReturnType(org.apache.calcite.sql.SqlOperatorBinding opBinding)
inferReturnType
in class org.apache.calcite.sql.SqlOperator
public String getSignatureTemplate(int operandsCount)
getSignatureTemplate
in class org.apache.calcite.sql.SqlOperator
public org.apache.calcite.sql.SqlOperandCountRange getOperandCountRange()
getOperandCountRange
in class org.apache.calcite.sql.SqlOperator
public boolean checkOperandTypes(org.apache.calcite.sql.SqlCallBinding callBinding, boolean throwOnFailure)
checkOperandTypes
in class org.apache.calcite.sql.SqlOperator
public org.apache.calcite.sql.SqlSyntax getSyntax()
getSyntax
in class org.apache.calcite.sql.SqlFunction
public void unparse(org.apache.calcite.sql.SqlWriter writer, org.apache.calcite.sql.SqlCall call, int leftPrec, int rightPrec)
unparse
in class org.apache.calcite.sql.SqlFunction
public org.apache.calcite.sql.validate.SqlMonotonicity getMonotonicity(org.apache.calcite.sql.SqlOperatorBinding call)
getMonotonicity
in class org.apache.calcite.sql.SqlOperator
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.