Class SqlBetweenOperator
Syntax:
X [NOT] BETWEEN [ASYMMETRIC | SYMMETRIC] Y AND
Z
If the asymmetric/symmetric keywords are left out ASYMMETRIC is default.
This operator is always expanded (into something like Y <= X AND
X <= Z) before being converted into Rex nodes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines the "SYMMETRIC" and "ASYMMETRIC" keywords.Nested classes/interfaces inherited from class org.apache.calcite.sql.SqlSpecialOperator
SqlSpecialOperator.ReduceResult, SqlSpecialOperator.TokenSequence -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal SqlBetweenOperator.Flagstatic final intOrdinal of the 'lower' operand.static final intOrdinal of the 'upper' operand.static final intOrdinal of the 'value' operand.Fields inherited from class org.apache.calcite.sql.SqlOperator
kind, MDX_PRECEDENCE, NL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()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.booleanReturns whether this is 'NOT' variant of an operator.not()Returns the operator that is the logical inverse of this operator.reduceExpr(int opOrdinal, SqlSpecialOperator.TokenSequence list) Reduces a list of operators and arguments according to the rules of precedence and associativity.voidWrites a SQL representation of a call to this operator to a writer, including parentheses if the operators on either side are of greater precedence.booleanvalidRexOperands(int count, Litmus litmus) Returns whether the given operands are valid.Methods inherited from class org.apache.calcite.sql.SqlSpecialOperator
getSyntaxMethods 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, deriveType, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getMonotonicity, getNameAsId, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getSqlCallFactory, getStrongPolicyInference, hashCode, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, isSymmetrical, leftPrec, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, reverse, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateCall, validateOperands
-
Field Details
-
VALUE_OPERAND
public static final int VALUE_OPERANDOrdinal of the 'value' operand.- See Also:
-
LOWER_OPERAND
public static final int LOWER_OPERANDOrdinal of the 'lower' operand.- See Also:
-
UPPER_OPERAND
public static final int UPPER_OPERANDOrdinal of the 'upper' operand.- See Also:
-
flag
-
-
Constructor Details
-
SqlBetweenOperator
-
-
Method Details
-
validRexOperands
Description copied from class:SqlOperatorReturns whether the given operands are valid. If not valid andfail, 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 inSqlNodeandRexNodeformats (some examples are CAST and AND), and this method throws internal errors, not user errors.- Overrides:
validRexOperandsin classSqlOperator
-
isNegated
public boolean isNegated()Returns whether this is 'NOT' variant of an operator.- See Also:
-
not
Description copied from class:SqlOperatorReturns the operator that is the logical inverse of this operator.For example,
SqlStdOperatorTable.LIKE.not()returnsSqlStdOperatorTable.NOT_LIKE, and vice versa.By default, returns
null, which means there is no inverse operator.- Overrides:
notin classSqlOperator- 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 classSqlOperator- Parameters:
opBinding- description of invocation (not necessarily aSqlCall)- Returns:
- inferred return type
-
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 classSqlOperator- 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
-
getName
- Overrides:
getNamein classSqlOperator
-
unparse
Description copied from class:SqlOperatorWrites a SQL representation of a call to this operator to a writer, including parentheses if the operators on either side are of greater precedence.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).- Overrides:
unparsein classSqlInfixOperator
-
reduceExpr
public SqlSpecialOperator.ReduceResult reduceExpr(int opOrdinal, SqlSpecialOperator.TokenSequence list) Description copied from class:SqlSpecialOperatorReduces a list of operators and arguments according to the rules of precedence and associativity. Returns the ordinal of the node which replaced the expression.The default implementation throws
UnsupportedOperationException.- Overrides:
reduceExprin classSqlSpecialOperator- Parameters:
opOrdinal- indicating the ordinal of the current operator in the list on which a possible reduction can be madelist- List of alternatingSqlParserUtil.ToTreeListItemandSqlNode- Returns:
- ordinal of the node which replaced the expression
-