public class SelectScope extends ListScope
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| Modifier and Type | Field and Description |
|---|---|
protected List<String> |
windowNames |
parent, validator| Modifier and Type | Method and Description |
|---|---|
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) |
addChild, findAliases, findAllColumnNames, findChild, findQualifyingTableName, getChild, getChild, getChildren, resolve, resolveColumnaddColumnNames, fullyQualify, getOperandScope, getParent, getTableNamespace, getValidator, nullifyType, validateExprpublic SqlValidatorTable getTable()
public SqlSelect getNode()
SqlValidatorScopepublic SqlWindow lookupWindow(String name)
SqlValidatorScopelookupWindow in interface SqlValidatorScopelookupWindow in class DelegatingScopepublic SqlMonotonicity getMonotonicity(SqlNode expr)
SqlValidatorScopegetMonotonicity in interface SqlValidatorScopegetMonotonicity in class DelegatingScopepublic SqlNodeList getOrderList()
SqlValidatorScopegetOrderList in interface SqlValidatorScopegetOrderList in class DelegatingScopepublic void addWindowName(String winName)
public boolean existingWindowName(String winName)
Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.