class WithScope extends ListScope
For example, in
WITH t1 AS (q1) t2 AS (q2) q3
t1 provides a scope that is used to validate q2
(and therefore q2 may reference t1),
and t2 provides a scope that is used to validate q3
(and therefore q3 may reference t1 and t2).
SqlValidatorScope.EmptyPath, SqlValidatorScope.Path, SqlValidatorScope.Resolve, SqlValidatorScope.Resolved, SqlValidatorScope.ResolvedImpl, SqlValidatorScope.Step| Modifier and Type | Field and Description |
|---|---|
private SqlWithItem |
withItem |
parent, validator| Constructor and Description |
|---|
WithScope(SqlValidatorScope parent,
SqlWithItem withItem)
Creates a WithScope.
|
| Modifier and Type | Method and Description |
|---|---|
SqlNode |
getNode()
Returns the root node of this scope.
|
SqlValidatorNamespace |
getTableNamespace(List<String> names) |
void |
resolve(List<String> names,
SqlNameMatcher nameMatcher,
boolean deep,
SqlValidatorScope.Resolved resolved)
Looks up a node with a given name.
|
void |
resolveTable(List<String> names,
SqlNameMatcher nameMatcher,
SqlValidatorScope.Path path,
SqlValidatorScope.Resolved resolved)
Looks up a table in this scope from its name.
|
addChild, findAliases, findAllColumnNames, findQualifyingTableName, findQualifyingTableNames, getChildNames, getChildren, resolveColumnaddColumnNames, fullyQualify, getMonotonicity, getOperandScope, getOrderList, getParent, getValidator, lookupWindow, nullifyType, resolveInNamespace, validateExprprivate final SqlWithItem withItem
WithScope(SqlValidatorScope parent, SqlWithItem withItem)
public SqlNode getNode()
SqlValidatorScopepublic SqlValidatorNamespace getTableNamespace(List<String> names)
getTableNamespace in interface SqlValidatorScopegetTableNamespace in class DelegatingScopepublic void resolveTable(List<String> names, SqlNameMatcher nameMatcher, SqlValidatorScope.Path path, SqlValidatorScope.Resolved resolved)
SqlValidatorScopeSqlValidatorScope.resolve(List, SqlNameMatcher, boolean, Resolved).
TableNamespace that wraps it. If the "table" is defined in a
WITH clause it may be a query, not a table after all.
The name matcher is not null, and one typically uses
SqlValidatorCatalogReader.nameMatcher().
resolveTable in interface SqlValidatorScoperesolveTable in class DelegatingScopenames - Name of table, may be qualified or fully-qualifiednameMatcher - Name matcherpath - List of names that we have traversed through so farpublic void resolve(List<String> names, SqlNameMatcher nameMatcher, boolean deep, SqlValidatorScope.Resolved resolved)
SqlValidatorScoperesolve in interface SqlValidatorScoperesolve in class ListScopenames - Name of node to find, maybe partially or fully qualifiednameMatcher - Name matcherdeep - Whether to look more than one level deepresolved - Callback wherein to write the match(es) we findCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.