|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eigenbase.sql.validate.DelegatingScope
org.eigenbase.sql.validate.ListScope
org.eigenbase.sql.validate.SelectScope
public class SelectScope
The name-resolution scope of a SELECT clause. The objects visible are those in the FROM clause, and objects inherited from the parent scope.
This object is both a SqlValidatorScope and a SqlValidatorNamespace. In the query
SELECT name FROM (
SELECT *
FROM emp
WHERE gender = 'F')
we need to use the SelectScope as a
SqlValidatorNamespace when resolving 'name', and
as a SqlValidatorScope when resolving 'gender'.
In the query
SELECT expr1
FROM t1,
t2,
(SELECT expr2 FROM t3) AS q3
WHERE c1 IN (SELECT expr3 FROM t4)
ORDER BY expr4
The scopes available at various points of the query are as follows:
In the above query, there are 4 namespaces:
SelectNamespace| Field Summary | |
|---|---|
private List<SqlNode> |
expandedSelectList
|
private SqlNodeList |
orderList
List of column names which sort this scope. |
private SqlSelect |
select
|
protected List<String> |
windowNames
|
private SqlValidatorScope |
windowParent
Scope to use to resolve windows |
| Fields inherited from class org.eigenbase.sql.validate.ListScope |
|---|
children, childrenNames |
| Fields inherited from class org.eigenbase.sql.validate.DelegatingScope |
|---|
parent, validator |
| Constructor Summary | |
|---|---|
SelectScope(SqlValidatorScope parent,
SqlValidatorScope winParent,
SqlSelect select)
Creates a scope corresponding to a SELECT clause. |
|
| Method Summary | |
|---|---|
void |
addWindowName(String winName)
|
boolean |
existingWindowName(String winName)
|
List<SqlNode> |
getExpandedSelectList()
|
SqlMonotonicity |
getMonotonicity(SqlNode expr)
Returns whether an expression is monotonic in this scope. |
SqlSelect |
getNode()
Returns the root node of this scope. |
SqlNodeList |
getOrderList()
Returns the expressions by which the rows in this scope are sorted. |
SqlValidatorTable |
getTable()
|
SqlWindow |
lookupWindow(String name)
Finds a window with a given name. |
void |
setExpandedSelectList(List<SqlNode> selectList)
|
| Methods inherited from class org.eigenbase.sql.validate.ListScope |
|---|
addChild, findAliases, findAllColumnNames, findQualifyingTableName, getChild, getChildren, resolve, resolveColumn |
| Methods inherited from class org.eigenbase.sql.validate.DelegatingScope |
|---|
addColumnNames, fullyQualify, getOperandScope, getParent, getValidator, validateExpr |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final SqlSelect select
protected final List<String> windowNames
private List<SqlNode> expandedSelectList
private SqlNodeList orderList
private final SqlValidatorScope windowParent
| Constructor Detail |
|---|
SelectScope(SqlValidatorScope parent,
SqlValidatorScope winParent,
SqlSelect select)
parent - Parent scope, must not be nullwinParent - Scope for window parent, may be nullselect - Select clause| Method Detail |
|---|
public SqlValidatorTable getTable()
public SqlSelect getNode()
SqlValidatorScope
public SqlWindow lookupWindow(String name)
SqlValidatorScope
lookupWindow in interface SqlValidatorScopelookupWindow in class DelegatingScopepublic SqlMonotonicity getMonotonicity(SqlNode expr)
SqlValidatorScope
getMonotonicity in interface SqlValidatorScopegetMonotonicity in class DelegatingScopepublic SqlNodeList getOrderList()
SqlValidatorScope
getOrderList in interface SqlValidatorScopegetOrderList in class DelegatingScopepublic void addWindowName(String winName)
public boolean existingWindowName(String winName)
public List<SqlNode> getExpandedSelectList()
public void setExpandedSelectList(List<SqlNode> selectList)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||