public abstract class ListScope extends DelegatingScope
SqlValidatorScope.EmptyPath, SqlValidatorScope.Path, SqlValidatorScope.Resolve, SqlValidatorScope.Resolved, SqlValidatorScope.ResolvedImpl, SqlValidatorScope.Step| Modifier and Type | Field and Description |
|---|---|
List<ScopeChild> |
children
List of child
SqlValidatorNamespace objects and their names. |
parent, validator| Constructor and Description |
|---|
ListScope(SqlValidatorScope parent) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(SqlValidatorNamespace ns,
String alias,
boolean nullable)
Registers a relation in this scope.
|
void |
findAliases(Collection<SqlMoniker> result)
Collects the
SqlMonikers of all table aliases (uses of tables in
query FROM clauses) available in this scope. |
void |
findAllColumnNames(List<SqlMoniker> result)
Collects the
SqlMonikers of all possible columns in this scope. |
private ScopeChild |
findChild(List<String> names,
SqlNameMatcher nameMatcher) |
Pair<String,SqlValidatorNamespace> |
findQualifyingTableName(String columnName,
SqlNode ctx) |
Map<String,ScopeChild> |
findQualifyingTableNames(String columnName,
SqlNode ctx,
SqlNameMatcher nameMatcher)
Finds all table aliases which are implicitly qualifying an unqualified
column name.
|
(package private) List<String> |
getChildNames()
Returns an immutable list of child names.
|
List<SqlValidatorNamespace> |
getChildren()
Returns an immutable list of child namespaces.
|
void |
resolve(List<String> names,
SqlNameMatcher nameMatcher,
boolean deep,
SqlValidatorScope.Resolved resolved)
Looks up a node with a given name.
|
RelDataType |
resolveColumn(String columnName,
SqlNode ctx)
Resolves a single identifier to a column, and returns the datatype of
that column.
|
addColumnNames, fullyQualify, getMonotonicity, getOperandScope, getOrderList, getParent, getTableNamespace, getValidator, lookupWindow, nullifyType, resolveInNamespace, resolveTable, validateExprclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetNodepublic final List<ScopeChild> children
SqlValidatorNamespace objects and their names.public ListScope(SqlValidatorScope parent)
public void addChild(SqlValidatorNamespace ns, String alias, boolean nullable)
SqlValidatorScopeaddChild in interface SqlValidatorScopeaddChild in class DelegatingScopens - Namespace representing the result-columns of the relationalias - Alias with which to reference the relation, must not be nullnullable - Whether this is a null-generating side of a joinpublic List<SqlValidatorNamespace> getChildren()
List<String> getChildNames()
private ScopeChild findChild(List<String> names, SqlNameMatcher nameMatcher)
public void findAllColumnNames(List<SqlMoniker> result)
SqlValidatorScopeSqlMonikers of all possible columns in this scope.findAllColumnNames in interface SqlValidatorScopefindAllColumnNames in class DelegatingScoperesult - an array list of strings to add the result topublic void findAliases(Collection<SqlMoniker> result)
SqlValidatorScopeSqlMonikers of all table aliases (uses of tables in
query FROM clauses) available in this scope.findAliases in interface SqlValidatorScopefindAliases in class DelegatingScoperesult - a list of monikers to add the result topublic Pair<String,SqlValidatorNamespace> findQualifyingTableName(String columnName, SqlNode ctx)
findQualifyingTableName in interface SqlValidatorScopefindQualifyingTableName in class DelegatingScopepublic Map<String,ScopeChild> findQualifyingTableNames(String columnName, SqlNode ctx, SqlNameMatcher nameMatcher)
SqlValidatorScopeThis method is only implemented in scopes (such as
SelectScope) which can be the
context for name-resolution. In scopes such as
IdentifierNamespace, it throws
UnsupportedOperationException.
findQualifyingTableNames in interface SqlValidatorScopefindQualifyingTableNames in class DelegatingScopecolumnName - Column namectx - Validation context, to appear in any error thrownnameMatcher - Name matcherpublic void resolve(List<String> names, SqlNameMatcher nameMatcher, boolean deep, SqlValidatorScope.Resolved resolved)
SqlValidatorScoperesolve in interface SqlValidatorScoperesolve in class DelegatingScopenames - 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 findpublic RelDataType resolveColumn(String columnName, SqlNode ctx)
SqlValidatorScopeIf it cannot find the column, returns null. If the column is
ambiguous, throws an error with context ctx.
resolveColumn in interface SqlValidatorScoperesolveColumn in class DelegatingScopecolumnName - Name of columnctx - Context for exceptionCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.