|
|||||||||
| 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
public abstract class ListScope
Abstract base for a scope which is defined by a list of child namespaces and which inherits from a parent scope.
| Field Summary | |
|---|---|
protected List<SqlValidatorNamespace> |
children
List of child SqlValidatorNamespace objects. |
protected List<String> |
childrenNames
Aliases of the SqlValidatorNamespace objects. |
| Fields inherited from class org.eigenbase.sql.validate.DelegatingScope |
|---|
parent, validator |
| Constructor Summary | |
|---|---|
ListScope(SqlValidatorScope parent)
|
|
| Method Summary | |
|---|---|
void |
addChild(SqlValidatorNamespace ns,
String alias)
Registers a relation in this scope. |
void |
findAliases(List<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. |
String |
findQualifyingTableName(String columnName,
SqlNode ctx)
Finds the table alias which is implicitly qualifying an unqualified column name. |
protected SqlValidatorNamespace |
getChild(String alias)
|
List<SqlValidatorNamespace> |
getChildren()
Returns an immutable list of child namespaces. |
SqlValidatorNamespace |
resolve(String name,
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. |
| Methods inherited from class org.eigenbase.sql.validate.DelegatingScope |
|---|
addColumnNames, fullyQualify, getMonotonicity, getOperandScope, getOrderList, getParent, getValidator, lookupWindow, validateExpr |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eigenbase.sql.validate.SqlValidatorScope |
|---|
getNode |
| Field Detail |
|---|
protected final List<SqlValidatorNamespace> children
SqlValidatorNamespace objects.
protected final List<String> childrenNames
SqlValidatorNamespace objects.
| Constructor Detail |
|---|
public ListScope(SqlValidatorScope parent)
| Method Detail |
|---|
public void addChild(SqlValidatorNamespace ns,
String alias)
SqlValidatorScope
addChild 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)
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(List<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 to
public String 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 thrown
public SqlValidatorNamespace resolve(String name,
SqlValidatorScope[] ancestorOut,
int[] offsetOut)
SqlValidatorScope
resolve in interface SqlValidatorScoperesolve in class DelegatingScopename - Name of node to findancestorOut - If not null, writes the ancestor scope hereoffsetOut - If not null, writes the offset within the ancestor here
public 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 exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||