Package org.apache.calcite.sql.validate
Class OrderByScope
java.lang.Object
org.apache.calcite.sql.validate.DelegatingScope
org.apache.calcite.sql.validate.OrderByScope
- All Implemented Interfaces:
SqlValidatorScope
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.sql.validate.SqlValidatorScope
SqlValidatorScope.EmptyPath, SqlValidatorScope.Path, SqlValidatorScope.Resolve, SqlValidatorScope.Resolved, SqlValidatorScope.ResolvedImpl, SqlValidatorScope.Step -
Field Summary
Fields inherited from class org.apache.calcite.sql.validate.DelegatingScope
parent, resolved, validator -
Method Summary
Modifier and TypeMethodDescriptionvoidfindAllColumnNames(List<SqlMoniker> result) Collects theSqlMonikers of all possible columns in this scope.fullyQualify(SqlIdentifier identifier) Converts an identifier into a fully-qualified identifier.getNode()Returns the root node of this scope.@Nullable RelDataTyperesolveColumn(String name, SqlNode ctx) Resolves a single identifier to a column, and returns the datatype of that column.voidvalidateExpr(SqlNode expr) Performs any scope-specific validation of an expression.Methods inherited from class org.apache.calcite.sql.validate.DelegatingScope
addChild, addColumnNames, analyze, findAliases, findQualifyingTableName, findQualifyingTableNames, getMonotonicity, getOperandScope, getOrderList, getParent, getTableNamespace, getValidator, lookupWindow, nullifyType, qualifyUsingAlias, resolve, resolveTableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.calcite.sql.validate.SqlValidatorScope
isMeasureRef, isWithin
-
Method Details
-
getNode
Description copied from interface:SqlValidatorScopeReturns the root node of this scope. Never null. -
findAllColumnNames
Description copied from interface:SqlValidatorScopeCollects theSqlMonikers of all possible columns in this scope.- Specified by:
findAllColumnNamesin interfaceSqlValidatorScope- Overrides:
findAllColumnNamesin classDelegatingScope- Parameters:
result- an array list of strings to add the result to
-
fullyQualify
Description copied from class:DelegatingScopeConverts an identifier into a fully-qualified identifier. For example, the "empno" in "select empno from emp natural join dept" becomes "emp.empno".If the identifier cannot be resolved, throws. Never returns null.
- Specified by:
fullyQualifyin interfaceSqlValidatorScope- Overrides:
fullyQualifyin classDelegatingScope- Returns:
- A qualified identifier, never null
-
resolveColumn
Description copied from interface:SqlValidatorScopeResolves a single identifier to a column, and returns the datatype of that column.If it cannot find the column, returns null. If the column is ambiguous, throws an error with context
ctx.- Specified by:
resolveColumnin interfaceSqlValidatorScope- Overrides:
resolveColumnin classDelegatingScope- Parameters:
name- Name of columnctx- Context for exception- Returns:
- Type of column, if found and unambiguous; null if not found
-
validateExpr
Description copied from interface:SqlValidatorScopePerforms any scope-specific validation of an expression. For example, an aggregating scope requires that expressions are valid aggregations. The expression has already been validated.- Specified by:
validateExprin interfaceSqlValidatorScope- Overrides:
validateExprin classDelegatingScope
-