Package org.apache.calcite.sql.validate
Class JoinScope
- java.lang.Object
-
- org.apache.calcite.sql.validate.DelegatingScope
-
- org.apache.calcite.sql.validate.ListScope
-
- org.apache.calcite.sql.validate.JoinScope
-
- All Implemented Interfaces:
SqlValidatorScope
public class JoinScope extends ListScope
The name-resolution context for expression inside a JOIN clause. The objects visible are the joined table expressions, and those inherited from the parent scope.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.
-
-
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 Modifier and Type Field Description private SqlJoin
join
private SqlValidatorScope
usingScope
-
Fields inherited from class org.apache.calcite.sql.validate.DelegatingScope
parent, validator
-
-
Constructor Summary
Constructors Constructor Description JoinScope(SqlValidatorScope parent, SqlValidatorScope usingScope, SqlJoin join)
Creates aJoinScope
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 withinscope2
in such a way that it can see the contents ofscope2
.SqlWindow
lookupWindow(java.lang.String name)
Finds a window with a given name.-
Methods inherited from class org.apache.calcite.sql.validate.ListScope
findAliases, findAllColumnNames, findQualifyingTableName, findQualifyingTableNames, getChildNames, getChildren, resolve, resolveColumn
-
Methods inherited from class org.apache.calcite.sql.validate.DelegatingScope
addColumnNames, fullyQualify, getMonotonicity, getOperandScope, getOrderList, getParent, getTableNamespace, getValidator, nullifyType, resolveInNamespace, resolveTable, validateExpr
-
-
-
-
Field Detail
-
usingScope
private final SqlValidatorScope usingScope
-
join
private final SqlJoin join
-
-
Constructor Detail
-
JoinScope
JoinScope(SqlValidatorScope parent, SqlValidatorScope usingScope, SqlJoin join)
Creates aJoinScope
.- Parameters:
parent
- Parent scopeusingScope
- Scope for resolving USING clausejoin
- Call to JOIN operator
-
-
Method Detail
-
getNode
public SqlNode getNode()
Description copied from interface:SqlValidatorScope
Returns the root node of this scope. Never null.
-
addChild
public void addChild(SqlValidatorNamespace ns, java.lang.String alias, boolean nullable)
Description copied from interface:SqlValidatorScope
Registers a relation in this scope.- Specified by:
addChild
in interfaceSqlValidatorScope
- Overrides:
addChild
in classListScope
- Parameters:
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 join
-
lookupWindow
public SqlWindow lookupWindow(java.lang.String name)
Description copied from interface:SqlValidatorScope
Finds a window with a given name. Returns null if not found.- Specified by:
lookupWindow
in interfaceSqlValidatorScope
- Overrides:
lookupWindow
in classDelegatingScope
-
getUsingScope
public SqlValidatorScope getUsingScope()
Returns the scope which is used for resolving USING clause.
-
isWithin
public boolean isWithin(SqlValidatorScope scope2)
Description copied from interface:SqlValidatorScope
Returns whether this scope is enclosed withinscope2
in such a way that it can see the contents ofscope2
.
-
-