public abstract class ListScope extends DelegatingScope
SqlValidatorScope.EmptyPath, SqlValidatorScope.Path, SqlValidatorScope.Resolve, SqlValidatorScope.Resolved, SqlValidatorScope.ResolvedImpl, SqlValidatorScope.Step| Modifier and Type | Field and Description |
|---|---|
List<org.apache.calcite.sql.validate.ScopeChild> |
children
List of child
SqlValidatorNamespace objects and their names. |
parent, validator| Modifier | Constructor and Description |
|---|---|
protected |
ListScope(SqlValidatorScope parent) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(SqlValidatorNamespace ns,
String alias,
boolean nullable)
Registers a relation in this scope.
|
void |
findAliases(Collection<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. |
Pair<String,SqlValidatorNamespace> |
findQualifyingTableName(String columnName,
SqlNode ctx) |
Map<String,org.apache.calcite.sql.validate.ScopeChild> |
findQualifyingTableNames(String columnName,
SqlNode ctx,
SqlNameMatcher nameMatcher)
Finds all table aliases which are implicitly qualifying an unqualified
column name.
|
List<SqlValidatorNamespace> |
getChildren()
Returns an immutable list of child namespaces.
|
boolean |
isChildNullable(int i)
Whether the ith child namespace produces nullable result.
|
void |
resolve(List<String> names,
SqlNameMatcher nameMatcher,
boolean deep,
SqlValidatorScope.Resolved resolved)
Looks up a node with a given name.
|
@Nullable RelDataType |
resolveColumn(String columnName,
SqlNode ctx)
Resolves a single identifier to a column, and returns the datatype of
that column.
|
addColumnNames, fullyQualify, getMonotonicity, getOperandScope, getOrderList, getParent, getTableNamespace, getValidator, lookupWindow, nullifyType, resolveTable, validateExprclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetNode, isWithinpublic final List<org.apache.calcite.sql.validate.ScopeChild> children
SqlValidatorNamespace objects and their names.protected ListScope(SqlValidatorScope parent)
public void addChild(SqlValidatorNamespace ns, String alias, boolean nullable)
SqlValidatorScopeaddChild in interface SqlValidatorScopeaddChild in class DelegatingScopens - Namespace representing the result-columns of the relationalias - Alias with which to reference the relation, must not be nullnullable - Whether this is a null-generating side of a joinpublic List<SqlValidatorNamespace> getChildren()
public boolean isChildNullable(int i)
SELECT * FROM EMPS LEFT OUTER JOIN DEPTthe namespace which corresponding to 'DEPT' is nullable.
i - The child index.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 void findAliases(Collection<SqlMoniker> result)
SqlValidatorScopeSqlMonikers of all table aliases (uses of tables in
query FROM clauses) available in this scope.findAliases in interface SqlValidatorScopefindAliases in class DelegatingScoperesult - a list of monikers to add the result topublic Pair<String,SqlValidatorNamespace> findQualifyingTableName(String columnName, SqlNode ctx)
findQualifyingTableName in interface SqlValidatorScopefindQualifyingTableName in class DelegatingScopepublic Map<String,org.apache.calcite.sql.validate.ScopeChild> findQualifyingTableNames(String columnName, SqlNode ctx, SqlNameMatcher nameMatcher)
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.
findQualifyingTableNames in interface SqlValidatorScopefindQualifyingTableNames in class DelegatingScopecolumnName - Column namectx - Validation context, to appear in any error thrownnameMatcher - Name matcherpublic void resolve(List<String> names, SqlNameMatcher nameMatcher, boolean deep, SqlValidatorScope.Resolved resolved)
SqlValidatorScoperesolve in interface SqlValidatorScoperesolve in class DelegatingScopenames - Name of node to find, maybe partially or fully qualifiednameMatcher - Name matcherdeep - Whether to look more than one level deepresolved - Callback wherein to write the match(es) we findpublic @Nullable RelDataType resolveColumn(String columnName, 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 DelegatingScopecolumnName - Name of columnctx - Context for exceptionCopyright © 2012-2022 Apache Software Foundation. All Rights Reserved.