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
Scope for expressions in a
MATCH_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 inherited from class org.apache.calcite.sql.validate.DelegatingScope
parent, resolved, validator
-
Constructor Summary
ConstructorDescriptionMatchRecognizeScope
(SqlValidatorScope parent, SqlMatchRecognize matchRecognize) Creates a MatchRecognizeScope. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPatternVar
(String str) findQualifyingTableNames
(String columnName, SqlNode ctx, SqlNameMatcher nameMatcher) Finds all table aliases which are implicitly qualifying an unqualified column name.getNode()
Returns the root node of this scope.void
resolve
(List<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, getChildren, isChildNullable, resolveColumn
Methods inherited from class org.apache.calcite.sql.validate.DelegatingScope
addColumnNames, analyze, fullyQualify, getMonotonicity, getOperandScope, getOrderList, getParent, getTableNamespace, getValidator, lookupWindow, nullifyType, qualifyUsingAlias, 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
isMeasureRef, isWithin
-
Constructor Details
-
MatchRecognizeScope
Creates a MatchRecognizeScope.
-
-
Method Details
-
getNode
Description copied from interface:SqlValidatorScope
Returns the root node of this scope. Never null. -
getMatchRecognize
-
getPatternVars
-
addPatternVar
-
findQualifyingTableNames
public Map<String,org.apache.calcite.sql.validate.ScopeChild> findQualifyingTableNames(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(List<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
-