public class SqlBetweenOperator extends SqlInfixOperator
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
SqlBetweenOperator.Flag
Defines the "SYMMETRIC" and "ASYMMETRIC" keywords.
|
SqlSpecialOperator.ReduceResult, SqlSpecialOperator.TokenSequence| Modifier and Type | Field and Description |
|---|---|
SqlBetweenOperator.Flag |
flag |
static int |
LOWER_OPERAND
Ordinal of the 'lower' operand.
|
static int |
UPPER_OPERAND
Ordinal of the 'upper' operand.
|
static int |
VALUE_OPERAND
Ordinal of the 'value' operand.
|
kind, MDX_PRECEDENCE, NL| Constructor and Description |
|---|
SqlBetweenOperator(SqlBetweenOperator.Flag flag,
boolean negated) |
| Modifier and Type | Method and Description |
|---|---|
String |
getName() |
String |
getSignatureTemplate(int operandsCount)
Returns a template describing how the operator signature is to be built.
|
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.
|
boolean |
isNegated()
Returns whether this is 'NOT' variant of an operator.
|
SqlOperator |
not()
Returns the operator that is the logical inverse of this operator.
|
SqlSpecialOperator.ReduceResult |
reduceExpr(int opOrdinal,
SqlSpecialOperator.TokenSequence list)
Reduces a list of operators and arguments according to the rules of
precedence and associativity.
|
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.
|
boolean |
validRexOperands(int count,
Litmus litmus)
Returns whether the given operands are valid.
|
getSyntaxacceptCall, acceptCall, adjustType, allowsFraming, argumentMustBeScalar, checkOperandCount, checkOperandTypes, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, createCall, createCall, createCall, deriveType, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getMonotonicity, getNameAsId, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getStrongPolicyInference, hashCode, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, isSymmetrical, leftPrec, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, reverse, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateCall, validateOperandspublic static final int VALUE_OPERAND
public static final int LOWER_OPERAND
public static final int UPPER_OPERAND
public final SqlBetweenOperator.Flag flag
public SqlBetweenOperator(SqlBetweenOperator.Flag flag, boolean negated)
public 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 SqlOperatorpublic boolean isNegated()
not()public SqlOperator not()
SqlOperatorFor example, SqlStdOperatorTable.LIKE.not() returns
SqlStdOperatorTable.NOT_LIKE, and vice versa.
By default, returns null, which means there is no inverse
operator.
not in class SqlOperatorSqlOperator.reverse()public RelDataType inferReturnType(SqlOperatorBinding opBinding)
SqlOperatorSqlReturnTypeInference to the constructor.inferReturnType in class SqlOperatoropBinding - description of invocation (not necessarily a
SqlCall)public String getSignatureTemplate(int operandsCount)
SqlOperatorgetSignatureTemplate in class SqlOperatoroperandsCount - is used with functions that can take a variable
number of operandspublic String getName()
getName in class SqlOperatorpublic void unparse(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec)
SqlOperatorThe 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 SqlInfixOperatorpublic SqlSpecialOperator.ReduceResult reduceExpr(int opOrdinal, SqlSpecialOperator.TokenSequence list)
SqlSpecialOperatorThe default implementation throws
UnsupportedOperationException.
reduceExpr in class SqlSpecialOperatoropOrdinal - indicating the ordinal of the current operator in the list
on which a possible reduction can be madelist - List of alternating
SqlParserUtil.ToTreeListItem and
SqlNodeCopyright © 2012-2022 Apache Software Foundation. All Rights Reserved.