public class JoinScope extends ListScope
Consider "SELECT * FROM (A JOIN B ON {exp1}) JOIN C ON {exp2}". {exp1} is resolved in the join scope for "A JOIN B", which contains A and B but not C.
SqlValidatorScope.EmptyPath, SqlValidatorScope.Path, SqlValidatorScope.Resolve, SqlValidatorScope.Resolved, SqlValidatorScope.ResolvedImpl, SqlValidatorScope.Step
Modifier and Type | Field and Description |
---|---|
private SqlJoin |
join |
private SqlValidatorScope |
usingScope |
parent, validator
Constructor and Description |
---|
JoinScope(SqlValidatorScope parent,
SqlValidatorScope usingScope,
SqlJoin join)
Creates a
JoinScope . |
Modifier and Type | Method and Description |
---|---|
void |
addChild(SqlValidatorNamespace ns,
java.lang.String alias,
boolean nullable)
Registers a relation in this scope.
|
SqlNode |
getNode()
Returns the root node of this scope.
|
SqlValidatorScope |
getUsingScope()
Returns the scope which is used for resolving USING clause.
|
boolean |
isWithin(SqlValidatorScope scope2)
Returns whether this scope is enclosed within
scope2 in such
a way that it can see the contents of scope2 . |
SqlWindow |
lookupWindow(java.lang.String name)
Finds a window with a given name.
|
findAliases, findAllColumnNames, findQualifyingTableName, findQualifyingTableNames, getChildNames, getChildren, resolve, resolveColumn
addColumnNames, fullyQualify, getMonotonicity, getOperandScope, getOrderList, getParent, getTableNamespace, getValidator, nullifyType, resolveInNamespace, resolveTable, validateExpr
private final SqlValidatorScope usingScope
private final SqlJoin join
JoinScope(SqlValidatorScope parent, SqlValidatorScope usingScope, SqlJoin join)
JoinScope
.parent
- Parent scopeusingScope
- Scope for resolving USING clausejoin
- Call to JOIN operatorpublic SqlNode getNode()
SqlValidatorScope
public void addChild(SqlValidatorNamespace ns, java.lang.String alias, boolean nullable)
SqlValidatorScope
addChild
in interface SqlValidatorScope
addChild
in class ListScope
ns
- 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 SqlWindow lookupWindow(java.lang.String name)
SqlValidatorScope
lookupWindow
in interface SqlValidatorScope
lookupWindow
in class DelegatingScope
public SqlValidatorScope getUsingScope()
public boolean isWithin(SqlValidatorScope scope2)
SqlValidatorScope
scope2
in such
a way that it can see the contents of scope2
.Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.