class LateralColumnAliasRegistryImpl extends LateralColumnAliasRegistry
LateralColumnAliasRegistryImpl is a utility class that contains structures required for lateral column alias resolution. Here we store:
- currentAttributeDependencyLevelStack - Current attribute dependency level in the scope. Dependency level is defined as a maximum dependency in that attribute's expression tree. For example, in a query like:
SELECT a, b, a + b AS c, a + c AS d
Dependency levels will be as follows: level 0: a, b level 1: c level 2: d
We add a new entry to the stack for each new Alias resolution. This is needed because we can have nesting Aliases in the plan, that do not belong to the same LCA scope. For example, in the following query:
SELECT STRUCT('alpha' AS A, 'beta' AS B) ST
ST, A and B would be aliases in the same expression tree, but they do not belong in the same LCA scope.
- availableAttributes - All attributes that can be laterally referenced. This map is indexed by name, but contains a list of attributes with the same name. This is because it is possible to have multiple attributes with the same name in the scope, but they can't be laterally referenced. Handling ambiguous references is done in the getAttribute method. For the following query:
SELECT 0 AS a, 1 AS b, 2 AS c, b AS d, a AS e, d AS f, a AS g, g AS h, h AS i
availableAttributes will be: {a, b, c, d, e, f, g, h, i}
- referencedAliases - Aliases that have been laterally referenced. For the given query example, referencedAliases will be: {a, b, d, g, h}
- aliasDependencyLevels - Dependency levels of all aliases, indexed by dependency level. For the given query example, dependency levels will be as follows:
level 0: a, b, c level 1: d, e, g level 2: f, h level 3: i
- Alphabetic
- By Inheritance
- LateralColumnAliasRegistryImpl
- LateralColumnAliasRegistry
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def getAliasDependencyLevels(): ArrayList[ArrayList[Alias]]
Returns the dependency levels of all aliases.
Returns the dependency levels of all aliases.
- Definition Classes
- LateralColumnAliasRegistryImpl → LateralColumnAliasRegistry
- def getAttribute(attributeName: String): Option[Attribute]
Gets the attribute needed for LCA resolution by given name from the set of available attributes.
Gets the attribute needed for LCA resolution by given name from the set of available attributes. If there are multiple matches, throws ambiguousLateralColumnAliasError error. If the method is called while resolving an Alias, updates the dependency level in the current scope.
- Definition Classes
- LateralColumnAliasRegistryImpl → LateralColumnAliasRegistry
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def isAttributeLaterallyReferenced(attribute: Attribute): Boolean
Returns true if the attribute has been laterally referenced, false otherwise.
Returns true if the attribute has been laterally referenced, false otherwise.
- Definition Classes
- LateralColumnAliasRegistryImpl → LateralColumnAliasRegistry
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def markAttributeLaterallyReferenced(attribute: Attribute): Unit
Adds an attribute to the set of attributes that have been laterally referenced.
Adds an attribute to the set of attributes that have been laterally referenced.
- Definition Classes
- LateralColumnAliasRegistryImpl → LateralColumnAliasRegistry
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def throwLcaResolutionNotEnabled(): Nothing
- Attributes
- protected
- Definition Classes
- LateralColumnAliasRegistry
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def withNewLcaScope(body: => Alias): Alias
Creates a new LCA resolution scope for each Alias resolution.
Creates a new LCA resolution scope for each Alias resolution. Executes the lambda and registers the resolved alias for later LCA resolution.
- Definition Classes
- LateralColumnAliasRegistryImpl → LateralColumnAliasRegistry
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)