public class SqlCastFunction extends SqlFunction
Modifier and Type | Field and Description |
---|---|
private com.google.common.collect.SetMultimap<SqlTypeFamily,SqlTypeFamily> |
nonMonotonicCasts
Map of all casts that do not preserve monotonicity.
|
kind, MDX_PRECEDENCE, NL
Constructor and Description |
---|
SqlCastFunction() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkOperandTypes(SqlCallBinding callBinding,
boolean throwOnFailure)
Makes sure that the number and types of arguments are allowable.
|
SqlMonotonicity |
getMonotonicity(SqlOperatorBinding call)
Returns whether a call to this operator is monotonic.
|
SqlOperandCountRange |
getOperandCountRange()
Returns a constraint on the number of operands expected by this operator.
|
java.lang.String |
getSignatureTemplate(int operandsCount)
Returns a template describing how the operator signature is to be built.
|
SqlSyntax |
getSyntax()
Returns the syntactic type of this operator, never null.
|
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.
|
void |
unparse(SqlWriter writer,
SqlCall call,
int leftPrec,
int rightPrec)
Writes a SQL representation of a call to this operator to a writer,
including parentheses if the operators on either side are of greater
precedence.
|
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, hashCode, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, leftPrec, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateOperands, validRexOperands
private final com.google.common.collect.SetMultimap<SqlTypeFamily,SqlTypeFamily> nonMonotonicCasts
public RelDataType inferReturnType(SqlOperatorBinding opBinding)
SqlOperator
SqlReturnTypeInference
to the constructor.inferReturnType
in class SqlOperator
opBinding
- description of invocation (not necessarily a
SqlCall
)public java.lang.String getSignatureTemplate(int operandsCount)
SqlOperator
getSignatureTemplate
in class SqlOperator
operandsCount
- is used with functions that can take a variable
number of operandspublic SqlOperandCountRange getOperandCountRange()
SqlOperator
SqlOperandTypeChecker
associated with this
operator.getOperandCountRange
in class SqlOperator
public boolean checkOperandTypes(SqlCallBinding callBinding, boolean throwOnFailure)
checkOperandTypes
in class SqlOperator
callBinding
- description of callthrowOnFailure
- whether to throw an exception if check fails
(otherwise returns false in that case)public SqlSyntax getSyntax()
SqlOperator
getSyntax
in class SqlFunction
public void unparse(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec)
SqlOperator
The default implementation of this method delegates to
SqlSyntax.unparse(org.apache.calcite.sql.SqlWriter, org.apache.calcite.sql.SqlOperator, org.apache.calcite.sql.SqlCall, int, int)
.
unparse
in class SqlFunction
public SqlMonotonicity getMonotonicity(SqlOperatorBinding call)
SqlOperator
Default implementation returns SqlMonotonicity.NOT_MONOTONIC
.
getMonotonicity
in class SqlOperator
call
- Call to this operator with particular arguments and information
about the monotonicity of the argumentsCopyright © 2012–2019 The Apache Software Foundation. All rights reserved.