public class SqlBetweenOperator extends SqlInfixOperator
Syntax:
X [NOT] BETWEEN [ASYMMETRIC | SYMMETRIC] Y AND
Z
If the asymmetric/symmeteric 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 |
|---|---|
private static class |
SqlBetweenOperator.AndFinder
Finds an AND operator in an expression.
|
static class |
SqlBetweenOperator.Flag
Defines the "SYMMETRIC" and "ASYMMETRIC" keywords.
|
SqlSpecialOperator.ReduceResult, SqlSpecialOperator.TokenSequence| Modifier and Type | Field and Description |
|---|---|
private static String[] |
BETWEEN_NAMES |
SqlBetweenOperator.Flag |
flag |
private static SqlWriter.FrameType |
FRAME_TYPE |
static int |
LOWER_OPERAND
Ordinal of the 'lower' operand.
|
private boolean |
negated
If true the call represents 'NOT BETWEEN'.
|
private static String[] |
NOT_BETWEEN_NAMES |
private static SqlOperandTypeChecker |
OTC_CUSTOM
Custom operand-type checking strategy.
|
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 |
|---|---|
private List<RelDataType> |
collectOperandTypes(SqlValidator validator,
SqlValidatorScope scope,
SqlCall call) |
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() |
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.
|
getSyntaxacceptCall, acceptCall, adjustType, allowsFraming, argumentMustBeScalar, checkOperandCount, checkOperandTypes, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, deriveType, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getMonotonicity, getNameAsId, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, hashCode, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, leftPrec, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateCall, validateOperands, validRexOperandsprivate static final String[] BETWEEN_NAMES
private static final String[] NOT_BETWEEN_NAMES
public static final int VALUE_OPERAND
public static final int LOWER_OPERAND
public static final int UPPER_OPERAND
private static final SqlOperandTypeChecker OTC_CUSTOM
private static final SqlWriter.FrameType FRAME_TYPE
public final SqlBetweenOperator.Flag flag
private final boolean negated
public SqlBetweenOperator(SqlBetweenOperator.Flag flag, boolean negated)
public boolean isNegated()
private List<RelDataType> collectOperandTypes(SqlValidator validator, SqlValidatorScope scope, SqlCall call)
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–2018 The Apache Software Foundation. All rights reserved.