Package org.apache.calcite.sql.validate
Class MatchRecognizeScope
- java.lang.Object
-
- org.apache.calcite.sql.validate.DelegatingScope
-
- org.apache.calcite.sql.validate.ListScope
-
- org.apache.calcite.sql.validate.MatchRecognizeScope
-
- All Implemented Interfaces:
SqlValidatorScope
public class MatchRecognizeScope extends ListScope
Scope for expressions in aMATCH_RECOGNIZE
clause.Defines variables and uses them as prefix of columns reference.
-
-
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 SqlMatchRecognize
matchRecognize
private java.util.Set<java.lang.String>
patternVars
private static java.lang.String
STAR
-
Fields inherited from class org.apache.calcite.sql.validate.DelegatingScope
parent, validator
-
-
Constructor Summary
Constructors Constructor Description MatchRecognizeScope(SqlValidatorScope parent, SqlMatchRecognize matchRecognize)
Creates a MatchRecognizeScope.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPatternVar(java.lang.String str)
java.util.Map<java.lang.String,ScopeChild>
findQualifyingTableNames(java.lang.String columnName, SqlNode ctx, SqlNameMatcher nameMatcher)
Finds all table aliases which are implicitly qualifying an unqualified column name.SqlMatchRecognize
getMatchRecognize()
SqlNode
getNode()
Returns the root node of this scope.java.util.Set<java.lang.String>
getPatternVars()
void
resolve(java.util.List<java.lang.String> names, SqlNameMatcher nameMatcher, boolean deep, SqlValidatorScope.Resolved resolved)
Looks up a node with a given name.-
Methods inherited from class org.apache.calcite.sql.validate.ListScope
addChild, findAliases, findAllColumnNames, findQualifyingTableName, getChildNames, getChildren, resolveColumn
-
Methods inherited from class org.apache.calcite.sql.validate.DelegatingScope
addColumnNames, fullyQualify, getMonotonicity, getOperandScope, getOrderList, getParent, getTableNamespace, getValidator, lookupWindow, nullifyType, resolveInNamespace, resolveTable, validateExpr
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.calcite.sql.validate.SqlValidatorScope
isWithin
-
-
-
-
Field Detail
-
STAR
private static final java.lang.String STAR
- See Also:
- Constant Field Values
-
matchRecognize
private final SqlMatchRecognize matchRecognize
-
patternVars
private final java.util.Set<java.lang.String> patternVars
-
-
Constructor Detail
-
MatchRecognizeScope
public MatchRecognizeScope(SqlValidatorScope parent, SqlMatchRecognize matchRecognize)
Creates a MatchRecognizeScope.
-
-
Method Detail
-
getNode
public SqlNode getNode()
Description copied from interface:SqlValidatorScope
Returns the root node of this scope. Never null.
-
getMatchRecognize
public SqlMatchRecognize getMatchRecognize()
-
getPatternVars
public java.util.Set<java.lang.String> getPatternVars()
-
addPatternVar
public void addPatternVar(java.lang.String str)
-
findQualifyingTableNames
public java.util.Map<java.lang.String,ScopeChild> findQualifyingTableNames(java.lang.String columnName, SqlNode ctx, SqlNameMatcher nameMatcher)
Description copied from interface:SqlValidatorScope
Finds all table aliases which are implicitly qualifying an unqualified column name.This method is only implemented in scopes (such as
SelectScope
) which can be the context for name-resolution. In scopes such asIdentifierNamespace
, it throwsUnsupportedOperationException
.- Specified by:
findQualifyingTableNames
in interfaceSqlValidatorScope
- Overrides:
findQualifyingTableNames
in classListScope
- Parameters:
columnName
- Column namectx
- Validation context, to appear in any error thrownnameMatcher
- Name matcher- Returns:
- Map of applicable table alias and namespaces, never null, empty if no aliases found
-
resolve
public void resolve(java.util.List<java.lang.String> names, SqlNameMatcher nameMatcher, boolean deep, SqlValidatorScope.Resolved resolved)
Description copied from interface:SqlValidatorScope
Looks up a node with a given name. Returns null if none is found.- Specified by:
resolve
in interfaceSqlValidatorScope
- Overrides:
resolve
in classListScope
- Parameters:
names
- 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 find
-
-