|
|||||||||
| 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.OrderByScope
public class OrderByScope
Represents the name-resolution context for expressions in an ORDER BY clause.
In some dialects of SQL, the ORDER BY clause can reference column aliases in the SELECT clause. For example, the query
SELECT empno AS x
FROM emp
ORDER BY x
is valid.
| Field Summary | |
|---|---|
private SqlNodeList |
orderList
|
private SqlSelect |
select
|
| Fields inherited from class org.eigenbase.sql.validate.DelegatingScope |
|---|
parent, validator |
| Constructor Summary | |
|---|---|
OrderByScope(SqlValidatorScope parent,
SqlNodeList orderList,
SqlSelect select)
|
|
| Method Summary | |
|---|---|
void |
findAllColumnNames(List<SqlMoniker> result)
Collects the SqlMonikers of all possible columns in this scope. |
SqlIdentifier |
fullyQualify(SqlIdentifier identifier)
Converts an identifier into a fully-qualified identifier. |
SqlNode |
getNode()
Returns the root node of this scope. |
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 org.eigenbase.sql.validate.DelegatingScope |
|---|
addChild, addColumnNames, findAliases, findQualifyingTableName, getMonotonicity, getOperandScope, getOrderList, getParent, getValidator, lookupWindow, resolve |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final SqlNodeList orderList
private final SqlSelect select
| Constructor Detail |
|---|
OrderByScope(SqlValidatorScope parent,
SqlNodeList orderList,
SqlSelect select)
| Method Detail |
|---|
public SqlNode getNode()
SqlValidatorScope
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 SqlIdentifier fullyQualify(SqlIdentifier identifier)
DelegatingScopeIf the identifier cannot be resolved, throws. Never returns null.
fullyQualify in interface SqlValidatorScopefullyQualify in class DelegatingScope
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 SqlValidatorScoperesolveColumn in class DelegatingScopename - Name of columnctx - Context for exception
public void validateExpr(SqlNode expr)
SqlValidatorScope
validateExpr in interface SqlValidatorScopevalidateExpr in class DelegatingScope
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||