public class SqlBinaryOperator extends SqlOperator
SqlBinaryOperator is a binary operator.kind, MDX_PRECEDENCE, NL| Constructor and Description |
|---|
SqlBinaryOperator(String name,
SqlKind kind,
int prec,
boolean leftAssoc,
@Nullable SqlReturnTypeInference returnTypeInference,
@Nullable SqlOperandTypeInference operandTypeInference,
@Nullable SqlOperandTypeChecker operandTypeChecker)
Creates a SqlBinaryOperator.
|
| Modifier and Type | Method and Description |
|---|---|
protected RelDataType |
adjustType(SqlValidator validator,
SqlCall call,
RelDataType type)
Validates and determines coercibility and resulting collation name of
binary operator if needed.
|
RelDataType |
deriveType(SqlValidator validator,
SqlValidatorScope scope,
SqlCall call)
Derives the type of a call to this operator.
|
SqlMonotonicity |
getMonotonicity(SqlOperatorBinding call)
Returns whether a call to this operator is monotonic.
|
@Nullable 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.
|
@Nullable SqlOperator |
reverse()
Returns the operator that has the same effect as this operator
if its arguments are reversed.
|
boolean |
validRexOperands(int count,
Litmus litmus)
Returns whether the given operands are valid.
|
acceptCall, acceptCall, allowsFraming, argumentMustBeScalar, checkOperandCount, checkOperandTypes, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, createCall, createCall, createCall, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getName, getNameAsId, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getStrongPolicyInference, hashCode, inferReturnType, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, isSymmetrical, leftPrec, not, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, rewriteCall, rightPrec, toString, unparse, unparseListClause, unparseListClause, validateCall, validateOperandspublic SqlBinaryOperator(String name, SqlKind kind, int prec, boolean leftAssoc, @Nullable SqlReturnTypeInference returnTypeInference, @Nullable SqlOperandTypeInference operandTypeInference, @Nullable SqlOperandTypeChecker operandTypeChecker)
name - Name of operatorkind - Kindprec - PrecedenceleftAssoc - Left-associativityreturnTypeInference - Strategy to infer return typeoperandTypeInference - Strategy to infer operand typesoperandTypeChecker - Validator for operand typespublic SqlSyntax getSyntax()
SqlOperatorgetSyntax in class SqlOperatorpublic @Nullable String getSignatureTemplate(int operandsCount)
SqlOperatorgetSignatureTemplate in class SqlOperatoroperandsCount - is used with functions that can take a variable
number of operandspublic @Nullable SqlOperator reverse()
SqlOperatorFor example, SqlStdOperatorTable.GREATER_THAN.reverse() returns
SqlStdOperatorTable.LESS_THAN, and vice versa,
because a > b is equivalent to b < a.
SqlStdOperatorTable.EQUALS.reverse() returns itself.
By default, returns null, which means there is no inverse
operator.
reverse in class SqlOperatorSqlOperator.not(),
SqlKind.reverse()protected RelDataType adjustType(SqlValidator validator, SqlCall call, RelDataType type)
SqlOperatoradjustType in class SqlOperatorpublic RelDataType deriveType(SqlValidator validator, SqlValidatorScope scope, SqlCall call)
SqlOperatorThis 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.
deriveType in class SqlOperatorvalidator - Validatorscope - Scope of validationcall - Call to this operatorpublic SqlMonotonicity getMonotonicity(SqlOperatorBinding call)
SqlOperatorDefault implementation returns SqlMonotonicity.NOT_MONOTONIC.
getMonotonicity in class SqlOperatorcall - Call to this operator with particular arguments and information
about the monotonicity of the argumentspublic boolean validRexOperands(int count,
Litmus litmus)
SqlOperatorfail, throws an assertion error.
Similar to SqlOperator.checkOperandCount(org.apache.calcite.sql.validate.SqlValidator, org.apache.calcite.sql.type.SqlOperandTypeChecker, org.apache.calcite.sql.SqlCall), but some operators may have
different valid operands in SqlNode and RexNode formats
(some examples are CAST and AND), and this method throws internal errors,
not user errors.
validRexOperands in class SqlOperatorCopyright © 2012-2022 Apache Software Foundation. All Rights Reserved.