public class OrderByScope extends DelegatingScope
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.
parent, validator| Modifier and Type | Method and Description |
|---|---|
void |
findAllColumnNames(List<SqlMoniker> result)
Collects the
SqlMonikers of all possible columns in this scope. |
SqlQualified |
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.
|
addChild, addColumnNames, findAliases, findQualifyingTableName, getMonotonicity, getOperandScope, getOrderList, getParent, getTableNamespace, getValidator, lookupWindow, nullifyType, resolvepublic SqlNode getNode()
SqlValidatorScopepublic 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 SqlQualified fullyQualify(SqlIdentifier identifier)
DelegatingScopeIf the identifier cannot be resolved, throws. Never returns null.
fullyQualify in interface SqlValidatorScopefullyQualify in class DelegatingScopepublic 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 exceptionpublic void validateExpr(SqlNode expr)
SqlValidatorScopevalidateExpr in interface SqlValidatorScopevalidateExpr in class DelegatingScopeCopyright © 2012–2015 The Apache Software Foundation. All rights reserved.