|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.sql.SqlOperator org.eigenbase.sql.SqlSpecialOperator org.eigenbase.sql.SqlInfixOperator org.eigenbase.sql.fun.SqlBetweenOperator
public class SqlBetweenOperator
Defines the BETWEEN operator.
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.
Nested Class Summary | |
---|---|
private static class |
SqlBetweenOperator.AndFinder
Finds an AND operator in an expression. |
static class |
SqlBetweenOperator.Flag
Defines the "SYMMETRIC" and "ASYMMETRIC" keywords. |
Field Summary | |
---|---|
private static SqlWriter.FrameType |
BetweenFrameType
|
private static String[] |
betweenNames
|
private SqlBetweenOperator.Flag |
flag
todo: Use a wrapper 'class SqlTempCall(SqlOperator,SqlParserPos) extends SqlNode' to store extra flags (neg and asymmetric) to calls to BETWEEN. |
static int |
LOWER_OPERAND
Ordinal of the 'lower' operand. |
private boolean |
negated
If true the call represents 'NOT BETWEEN'. |
private static String[] |
notBetweenNames
|
private static SqlOperandTypeChecker |
otcCustom
Custom operand-type checking strategy. |
static int |
SYMFLAG_OPERAND
Ordinal of the 'symmetric' operand. |
static int |
UPPER_OPERAND
Ordinal of the 'upper' operand. |
static int |
VALUE_OPERAND
Ordinal of the 'value' operand. |
Fields inherited from class org.eigenbase.sql.SqlOperator |
---|
MaxPrec, NL |
Constructor Summary | |
---|---|
SqlBetweenOperator(SqlBetweenOperator.Flag flag,
boolean negated)
|
Method Summary | |
---|---|
private RelDataType[] |
collectOperandTypes(SqlValidator validator,
SqlValidatorScope scope,
SqlCall call)
|
SqlOperandCountRange |
getOperandCountRange()
Returns a constraint on the number of operands expected by this operator. |
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()
|
int |
reduceExpr(int opOrdinal,
List<Object> list)
Reduces a list of operators and arguments according to the rules of precedence and associativity. |
void |
unparse(SqlWriter writer,
SqlNode[] operands,
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. |
Methods inherited from class org.eigenbase.sql.SqlInfixOperator |
---|
getSyntax |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final String[] betweenNames
private static final String[] notBetweenNames
public static final int VALUE_OPERAND
public static final int LOWER_OPERAND
public static final int UPPER_OPERAND
public static final int SYMFLAG_OPERAND
private static final SqlOperandTypeChecker otcCustom
private static final SqlWriter.FrameType BetweenFrameType
private final SqlBetweenOperator.Flag flag
private final boolean negated
Constructor Detail |
---|
public SqlBetweenOperator(SqlBetweenOperator.Flag flag, boolean negated)
Method Detail |
---|
public boolean isNegated()
private RelDataType[] collectOperandTypes(SqlValidator validator, SqlValidatorScope scope, SqlCall call)
public RelDataType inferReturnType(SqlOperatorBinding opBinding)
SqlOperator
SqlReturnTypeInference
to the constructor.
inferReturnType
in class SqlOperator
opBinding
- description of invocation (not necessarily a SqlCall
)
public String getSignatureTemplate(int operandsCount)
SqlOperator
getSignatureTemplate
in class SqlOperator
operandsCount
- is used with functions that can take a variable
number of operands
public SqlOperandCountRange getOperandCountRange()
SqlOperator
SqlOperandTypeChecker
associated with this
operator.
getOperandCountRange
in class SqlOperator
public void unparse(SqlWriter writer, SqlNode[] operands, int leftPrec, int rightPrec)
SqlOperator
The default implementation of this method delegates to SqlSyntax.unparse(org.eigenbase.sql.SqlWriter, org.eigenbase.sql.SqlOperator, org.eigenbase.sql.SqlNode[], int, int)
.
unparse
in class SqlInfixOperator
public int reduceExpr(int opOrdinal, List<Object> list)
SqlSpecialOperator
The default implementation throws UnsupportedOperationException
.
reduceExpr
in class SqlSpecialOperator
opOrdinal
- indicating the ordinal of the current operator in the list
on which a possible reduction can be madelist
- List of alternating SqlParserUtil.ToTreeListItem
and SqlNode
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |