|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eigenbase.sql.validate.DelegatingScope
public abstract class DelegatingScope
A scope which delegates all requests to its parent scope. Use this as a base class for defining nested scopes.
| Field Summary | |
|---|---|
protected SqlValidatorScope |
parent
Parent scope. |
protected SqlValidatorImpl |
validator
|
| Constructor Summary | |
|---|---|
DelegatingScope(SqlValidatorScope parent)
Creates a DelegatingScope. |
|
| Method Summary | |
|---|---|
void |
addChild(SqlValidatorNamespace ns,
String alias)
Registers a relation in this scope. |
protected void |
addColumnNames(SqlValidatorNamespace ns,
List<SqlMoniker> colNames)
|
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. |
SqlIdentifier |
fullyQualify(SqlIdentifier identifier)
Converts an identifier into a fully-qualified identifier. |
SqlMonotonicity |
getMonotonicity(SqlNode expr)
Returns whether an expression is monotonic in this scope. |
SqlValidatorScope |
getOperandScope(SqlCall call)
Returns the scope within which operands to a call are to be validated. |
SqlNodeList |
getOrderList()
Returns the expressions by which the rows in this scope are sorted. |
SqlValidatorScope |
getParent()
Returns the parent scope of this DelegatingScope. |
SqlValidator |
getValidator()
Returns the validator which created this scope. |
SqlWindow |
lookupWindow(String name)
Finds a window with a given name. |
SqlValidatorNamespace |
resolve(String name,
SqlValidatorScope[] ancestorOut,
int[] offsetOut)
Looks up a node with a given name. |
RelDataType |
resolveColumn(String name,
SqlNode ctx)
Resolves a single identifier to a column, and returns the datatype of that column. |
void |
validateExpr(SqlNode expr)
Performs any scope-specific validation of an expression. |
| 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 SqlValidatorScope parent
This is never null: at the top of the tree, it is an EmptyScope.
protected final SqlValidatorImpl validator
| Constructor Detail |
|---|
DelegatingScope(SqlValidatorScope parent)
DelegatingScope.
parent - Parent scope| Method Detail |
|---|
public void addChild(SqlValidatorNamespace ns,
String alias)
SqlValidatorScope
addChild in interface SqlValidatorScopens - Namespace representing the result-columns of the relationalias - Alias with which to reference the relation, must not be null
public SqlValidatorNamespace resolve(String name,
SqlValidatorScope[] ancestorOut,
int[] offsetOut)
SqlValidatorScope
resolve in interface SqlValidatorScopename - Name of node to findancestorOut - If not null, writes the ancestor scope hereoffsetOut - If not null, writes the offset within the ancestor here
protected void addColumnNames(SqlValidatorNamespace ns,
List<SqlMoniker> colNames)
public void findAllColumnNames(List<SqlMoniker> result)
SqlValidatorScopeSqlMonikers of all possible columns in this scope.
findAllColumnNames in interface SqlValidatorScoperesult - 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 SqlValidatorScoperesult - 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 SqlValidatorScopecolumnName - Column namectx - Validation context, to appear in any error thrown
public RelDataType resolveColumn(String name,
SqlNode ctx)
SqlValidatorScopeIf it cannot find the column, returns null. If the column is
ambiguous, throws an error with context ctx.
resolveColumn in interface SqlValidatorScopename - Name of columnctx - Context for exception
public SqlValidatorScope getOperandScope(SqlCall call)
SqlValidatorScope
getOperandScope in interface SqlValidatorScopecall - Call
public SqlValidator getValidator()
SqlValidatorScope
getValidator in interface SqlValidatorScopepublic SqlIdentifier fullyQualify(SqlIdentifier identifier)
If the identifier cannot be resolved, throws. Never returns null.
fullyQualify in interface SqlValidatorScopepublic void validateExpr(SqlNode expr)
SqlValidatorScope
validateExpr in interface SqlValidatorScopepublic SqlWindow lookupWindow(String name)
SqlValidatorScope
lookupWindow in interface SqlValidatorScopepublic SqlMonotonicity getMonotonicity(SqlNode expr)
SqlValidatorScope
getMonotonicity in interface SqlValidatorScopepublic SqlNodeList getOrderList()
SqlValidatorScope
getOrderList in interface SqlValidatorScopepublic SqlValidatorScope getParent()
DelegatingScope.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||