public abstract class ListScope extends DelegatingScope
| Modifier and Type | Field and Description |
|---|---|
protected List<Pair<String,SqlValidatorNamespace>> |
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)
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. |
protected int |
findChild(List<String> names) |
Pair<String,SqlValidatorNamespace> |
findQualifyingTableName(String columnName,
SqlNode ctx)
Finds the table alias which is implicitly qualifying an unqualified
column name.
|
protected SqlValidatorNamespace |
getChild(List<String> names)
Returns a child namespace that matches a fully-qualified list of names.
|
protected SqlValidatorNamespace |
getChild(String alias) |
List<SqlValidatorNamespace> |
getChildren()
Returns an immutable list of child namespaces.
|
SqlValidatorNamespace |
resolve(List<String> names,
SqlValidatorScope[] ancestorOut,
int[] offsetOut)
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, validateExprclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetNodeprotected final List<Pair<String,SqlValidatorNamespace>> children
SqlValidatorNamespace objects and their names.public ListScope(SqlValidatorScope parent)
public void addChild(SqlValidatorNamespace ns, String alias)
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 nullpublic List<SqlValidatorNamespace> getChildren()
protected SqlValidatorNamespace getChild(String alias)
protected SqlValidatorNamespace getChild(List<String> names)
SELECT sales.emp.empno FROM sales.emp
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)
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.
findQualifyingTableName in interface SqlValidatorScopefindQualifyingTableName in class DelegatingScopecolumnName - Column namectx - Validation context, to appear in any error thrownpublic SqlValidatorNamespace resolve(List<String> names, SqlValidatorScope[] ancestorOut, int[] offsetOut)
SqlValidatorScoperesolve in interface SqlValidatorScoperesolve in class DelegatingScopenames - Name of node to findancestorOut - If not null, writes the ancestor scope hereoffsetOut - If not null, writes the offset within the ancestor herepublic 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–2015 The Apache Software Foundation. All rights reserved.