|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 SqlMoniker s of all table aliases (uses of tables in
query FROM clauses) available in this scope. |
void |
findAllColumnNames(List<SqlMoniker> result)
Collects the SqlMoniker s 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 SqlValidatorScope
addChild
in class DelegatingScope
ns
- 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)
SqlValidatorScope
SqlMoniker
s of all possible columns in this scope.
findAllColumnNames
in interface SqlValidatorScope
findAllColumnNames
in class DelegatingScope
result
- an array list of strings to add the result topublic void findAliases(List<SqlMoniker> result)
SqlValidatorScope
SqlMoniker
s of all table aliases (uses of tables in
query FROM clauses) available in this scope.
findAliases
in interface SqlValidatorScope
findAliases
in class DelegatingScope
result
- a list of monikers to add the result topublic String findQualifyingTableName(String columnName, SqlNode ctx)
SqlValidatorScope
This 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 SqlValidatorScope
findQualifyingTableName
in class DelegatingScope
columnName
- Column namectx
- Validation context, to appear in any error thrown
public SqlValidatorNamespace resolve(String name, SqlValidatorScope[] ancestorOut, int[] offsetOut)
SqlValidatorScope
resolve
in interface SqlValidatorScope
resolve
in class DelegatingScope
name
- 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)
SqlValidatorScope
If it cannot find the column, returns null. If the column is
ambiguous, throws an error with context ctx
.
resolveColumn
in interface SqlValidatorScope
resolveColumn
in class DelegatingScope
columnName
- Name of columnctx
- Context for exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |