| Modifier and Type | Field and Description |
|---|---|
static int |
FROM_OPERAND |
static int |
HAVING_OPERAND |
static int |
WHERE_OPERAND |
EMPTY_ARRAY, pos| Constructor and Description |
|---|
SqlSelect(SqlParserPos pos,
SqlNodeList keywordList,
SqlNodeList selectList,
SqlNode from,
SqlNode where,
SqlNodeList groupBy,
SqlNode having,
SqlNodeList windowDecls,
SqlNodeList orderBy,
SqlNode offset,
SqlNode fetch) |
| Modifier and Type | Method and Description |
|---|---|
SqlNode |
getFetch() |
SqlNode |
getFrom() |
SqlNodeList |
getGroup() |
SqlNode |
getHaving() |
SqlKind |
getKind()
Returns the type of node this is, or
SqlKind.OTHER if it's nothing special. |
SqlNode |
getModifierNode(SqlSelectKeyword modifier) |
SqlNode |
getOffset() |
List<SqlNode> |
getOperandList() |
SqlOperator |
getOperator() |
SqlNodeList |
getOrderList() |
SqlNodeList |
getSelectList() |
SqlNode |
getWhere() |
SqlNodeList |
getWindowList() |
boolean |
hasOrderBy() |
boolean |
hasWhere() |
boolean |
isDistinct() |
boolean |
isKeywordPresent(SqlSelectKeyword targetKeyWord) |
void |
setFetch(SqlNode fetch) |
void |
setFrom(SqlNode from) |
void |
setGroupBy(SqlNodeList groupBy) |
void |
setOffset(SqlNode offset) |
void |
setOperand(int i,
SqlNode operand)
Changes the value of an operand.
|
void |
setOrderBy(SqlNodeList orderBy) |
void |
setSelectList(SqlNodeList selectList) |
void |
setWhere(SqlNode whereClause) |
void |
unparse(SqlWriter writer,
int leftPrec,
int rightPrec)
Writes a SQL representation of this node to a writer.
|
void |
validate(SqlValidator validator,
SqlValidatorScope scope)
Validates this call.
|
accept, clone, equalsDeep, findValidOptions, getCallSignature, getFunctionQuantifier, getMonotonicity, isCountStar, isExpanded, operand, operandCountclone, cloneArray, equalDeep, equalDeep, getParserPosition, isA, toSqlString, toSqlString, toString, validateExprpublic static final int FROM_OPERAND
public static final int WHERE_OPERAND
public static final int HAVING_OPERAND
public SqlSelect(SqlParserPos pos, SqlNodeList keywordList, SqlNodeList selectList, SqlNode from, SqlNode where, SqlNodeList groupBy, SqlNode having, SqlNodeList windowDecls, SqlNodeList orderBy, SqlNode offset, SqlNode fetch)
public SqlOperator getOperator()
getOperator in class SqlCallpublic SqlKind getKind()
SqlNodeSqlKind.OTHER if it's nothing special.getKind in class SqlNodeSqlKind value, never nullSqlNode.isA(java.util.Set<org.apache.calcite.sql.SqlKind>)public List<SqlNode> getOperandList()
getOperandList in class SqlCallpublic void setOperand(int i,
SqlNode operand)
SqlCallSqlValidator; use sparingly.setOperand in class SqlCalli - Operand indexoperand - Operand valuepublic final boolean isDistinct()
public final SqlNode getModifierNode(SqlSelectKeyword modifier)
public final SqlNode getFrom()
public void setFrom(SqlNode from)
public final SqlNodeList getGroup()
public void setGroupBy(SqlNodeList groupBy)
public final SqlNode getHaving()
public final SqlNodeList getSelectList()
public void setSelectList(SqlNodeList selectList)
public final SqlNode getWhere()
public void setWhere(SqlNode whereClause)
public final SqlNodeList getWindowList()
public final SqlNodeList getOrderList()
public void setOrderBy(SqlNodeList orderBy)
public final SqlNode getOffset()
public void setOffset(SqlNode offset)
public final SqlNode getFetch()
public void setFetch(SqlNode fetch)
public void validate(SqlValidator validator, SqlValidatorScope scope)
SqlCallThe default implementation delegates the validation to the operator's
SqlOperator.validateCall(org.apache.calcite.sql.SqlCall, org.apache.calcite.sql.validate.SqlValidator, org.apache.calcite.sql.validate.SqlValidatorScope, org.apache.calcite.sql.validate.SqlValidatorScope). Derived classes may override (as do,
for example SqlSelect and SqlUpdate).
public void unparse(SqlWriter writer, int leftPrec, int rightPrec)
SqlNodeThe leftPrec and rightPrec parameters give
us enough context to decide whether we need to enclose the expression in
parentheses. For example, we need parentheses around "2 + 3" if preceded
by "5 *". This is because the precedence of the "*" operator is greater
than the precedence of the "+" operator.
The algorithm handles left- and right-associative operators by giving them slightly different left- and right-precedence.
If SqlWriter.isAlwaysUseParentheses() is true, we use
parentheses even when they are not required by the precedence rules.
For the details of this algorithm, see SqlCall.unparse(org.apache.calcite.sql.SqlWriter, int, int).
public boolean hasOrderBy()
public boolean hasWhere()
public boolean isKeywordPresent(SqlSelectKeyword targetKeyWord)
Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.