| 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,
@Nullable SqlNodeList keywordList,
SqlNodeList selectList,
@Nullable SqlNode from,
@Nullable SqlNode where,
@Nullable SqlNodeList groupBy,
@Nullable SqlNode having,
@Nullable SqlNodeList windowDecls,
@Nullable SqlNodeList orderBy,
@Nullable SqlNode offset,
@Nullable SqlNode fetch,
@Nullable SqlNodeList hints) |
| Modifier and Type | Method and Description |
|---|---|
@Nullable SqlNode |
getFetch() |
@Nullable SqlNode |
getFrom() |
@Nullable SqlNodeList |
getGroup() |
@Nullable SqlNode |
getHaving() |
@Nullable SqlNodeList |
getHints() |
SqlKind |
getKind()
Returns the type of node this is, or
SqlKind.OTHER if it's nothing special. |
@Nullable SqlNode |
getModifierNode(SqlSelectKeyword modifier) |
@Nullable SqlNode |
getOffset() |
List<SqlNode> |
getOperandList()
Returns the list of operands.
|
SqlOperator |
getOperator() |
@Nullable SqlNodeList |
getOrderList() |
SqlNodeList |
getSelectList() |
@Nullable SqlNode |
getWhere() |
SqlNodeList |
getWindowList() |
boolean |
hasHints() |
boolean |
hasOrderBy() |
boolean |
hasWhere() |
boolean |
isDistinct() |
boolean |
isKeywordPresent(SqlSelectKeyword targetKeyWord) |
void |
setFetch(@Nullable SqlNode fetch) |
void |
setFrom(@Nullable SqlNode from) |
void |
setGroupBy(@Nullable SqlNodeList groupBy) |
void |
setHaving(@Nullable SqlNode having) |
void |
setHints(@Nullable SqlNodeList hints) |
void |
setOffset(@Nullable SqlNode offset) |
void |
setOperand(int i,
@Nullable SqlNode operand)
Changes the value of an operand.
|
void |
setOrderBy(@Nullable SqlNodeList orderBy) |
void |
setSelectList(SqlNodeList selectList) |
void |
setWhere(@Nullable 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, clone, cloneArray, equalDeep, equalDeep, equalsDeep, getParserPosition, isA, toList, toList, toSqlString, toSqlString, toSqlString, toString, unparseWithParentheses, validateExprpublic static final int FROM_OPERAND
public static final int WHERE_OPERAND
public static final int HAVING_OPERAND
public SqlSelect(SqlParserPos pos, @Nullable SqlNodeList keywordList, SqlNodeList selectList, @Nullable SqlNode from, @Nullable SqlNode where, @Nullable SqlNodeList groupBy, @Nullable SqlNode having, @Nullable SqlNodeList windowDecls, @Nullable SqlNodeList orderBy, @Nullable SqlNode offset, @Nullable SqlNode fetch, @Nullable SqlNodeList hints)
public SqlOperator getOperator()
getOperator in class SqlCallpublic SqlKind getKind()
SqlNodeSqlKind.OTHER if it's nothing special.getKind in class SqlCallSqlKind value, never nullSqlNode.isA(java.util.Set<org.apache.calcite.sql.SqlKind>)public List<SqlNode> getOperandList()
SqlCallNote: the proper type would be List<@Nullable SqlNode>, however,
it would trigger too many changes to the current codebase.
getOperandList in class SqlCallpublic void setOperand(int i,
@Nullable SqlNode operand)
SqlCallSqlValidator; use sparingly.setOperand in class SqlCalli - Operand indexoperand - Operand valuepublic final boolean isDistinct()
public final @Nullable SqlNode getModifierNode(SqlSelectKeyword modifier)
@Pure public final @Nullable SqlNode getFrom()
public void setFrom(@Nullable SqlNode from)
@Pure public final @Nullable SqlNodeList getGroup()
public void setGroupBy(@Nullable SqlNodeList groupBy)
@Pure public final @Nullable SqlNode getHaving()
public void setHaving(@Nullable SqlNode having)
@Pure public final SqlNodeList getSelectList()
public void setSelectList(SqlNodeList selectList)
@Pure public final @Nullable SqlNode getWhere()
public void setWhere(@Nullable SqlNode whereClause)
public final SqlNodeList getWindowList()
@Pure public final @Nullable SqlNodeList getOrderList()
public void setOrderBy(@Nullable SqlNodeList orderBy)
@Pure public final @Nullable SqlNode getOffset()
public void setOffset(@Nullable SqlNode offset)
@Pure public final @Nullable SqlNode getFetch()
public void setFetch(@Nullable SqlNode fetch)
public void setHints(@Nullable SqlNodeList hints)
@Pure public @Nullable SqlNodeList getHints()
@EnsuresNonNullIf(expression="hints",
result=true)
public boolean hasHints()
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-2022 Apache Software Foundation. All Rights Reserved.