class AliasResolver extends TreeNodeResolver[UnresolvedAlias, Expression] with ResolvesExpressionChildren with AliasHelper
Resolver class that resolves unresolved aliases and handles user-specified aliases.
- Alphabetic
- By Inheritance
- AliasResolver
- AliasHelper
- ResolvesExpressionChildren
- TreeNodeResolver
- QueryErrorsBase
- DataTypeErrorsBase
- SQLConfHelper
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new AliasResolver(expressionResolver: ExpressionResolver)
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()
- def conf: SQLConf
The active config object within the current scope.
The active config object within the current scope. See SQLConf.get for more information.
- Definition Classes
- SQLConfHelper
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def getAliasMap(exprs: Iterable[NamedExpression]): AttributeMap[Alias]
- Attributes
- protected
- Definition Classes
- AliasHelper
- def getAliasMap(plan: Aggregate): AttributeMap[Alias]
- Attributes
- protected
- Definition Classes
- AliasHelper
- def getAliasMap(plan: Project): AttributeMap[Alias]
- Attributes
- protected
- Definition Classes
- AliasHelper
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def getQueryContext(context: QueryContext): Array[QueryContext]
- Definition Classes
- DataTypeErrorsBase
- def getSummary(sqlContext: QueryContext): String
- Definition Classes
- DataTypeErrorsBase
- def handleResolvedAlias(alias: Alias): Alias
Handle already resolved Alias nodes, i.e.
Handle already resolved Alias nodes, i.e. user-specified aliases. Here we only need to resolve its children and afterwards reassign exprId to the resulting Alias. Resulting Alias must be added to the list of
availableAliasesin the current NameScope.When resolving grouping expressions, we may meet duplicate aliases from grouping expressions. This is only the case with partially resolved DataFrame logical plans. We need to deprioritize those aliases. See ExpressionIdAssigner.mapExpression doc for more details.
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def mergeAliases(alias: Alias): Alias
Merge an Alias(Alias(x)) into Alias(x) preserving metadata.
Merge an Alias(Alias(x)) into Alias(x) preserving metadata.
If the outer alias has explicit metadata, it is preserved. Else if the inner alias has explicit metadata, the result has explicit outer.metadata. Else both are deriving the metadata. the result is deriving metadata, with the union of noninheritable keys.
- alias
An Alias with a child Alias, Alias(Alias(x))
- returns
The merged alias, Alias(x)
- Attributes
- protected
- Definition Classes
- AliasHelper
- final def mergeAndTrimAliases(alias: Alias): Alias
Merge any stack of aliases under the top-level alias, and then drops any aliases deeper in the expression tree.
Merge any stack of aliases under the top-level alias, and then drops any aliases deeper in the expression tree. So Alias1(Alias2(Alias3(Foo(Alias4(x))))) becomes Alias5(Foo(x)) where Alias5 preserves the metadata of Alias{1,2,3} and the name and exprId of Alias1. Alias4 is simply removed.
- Attributes
- protected
- Definition Classes
- AliasHelper
- Annotations
- @tailrec()
- 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()
- def ordinalNumber(i: Int): String
- Definition Classes
- QueryErrorsBase
- def quoteByDefault(elem: String): String
- Attributes
- protected[sql]
- Definition Classes
- DataTypeErrorsBase
- def replaceAlias(expr: Expression, aliasMap: AttributeMap[Alias]): Expression
Replace all attributes, that reference an alias, with the aliased expression
Replace all attributes, that reference an alias, with the aliased expression
- Attributes
- protected
- Definition Classes
- AliasHelper
- def replaceAliasButKeepName(expr: NamedExpression, aliasMap: AttributeMap[Alias]): NamedExpression
Replace all attributes, that reference an alias, with the aliased expression, but keep the name of the outermost attribute.
Replace all attributes, that reference an alias, with the aliased expression, but keep the name of the outermost attribute.
- Attributes
- protected
- Definition Classes
- AliasHelper
- def resolve(unresolvedAlias: UnresolvedAlias): NamedExpression
Resolves UnresolvedAlias by resolving its child and computing the alias name by calling AliasResolution on the result.
Resolves UnresolvedAlias by resolving its child and computing the alias name by calling AliasResolution on the result. After resolving it, we assign a correct exprId to the resulting Alias. In case result of the AliasResolution call is an OuterReference, we create a new Alias using the AutoGeneratedAliasProvider. Here we allow inner aliases to persist until the end of single-pass resolution, after which they will be removed in the post-processing phase.
Resulting Alias must be added to the list of
availableAliasesin the current NameScope.- Definition Classes
- AliasResolver → TreeNodeResolver
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toDSOption(option: String): String
- Definition Classes
- DataTypeErrorsBase
- def toSQLConf(conf: String): String
- Definition Classes
- DataTypeErrorsBase
- def toSQLConfVal(conf: String): String
- Definition Classes
- QueryErrorsBase
- def toSQLExpr(e: Expression): String
- Definition Classes
- QueryErrorsBase
- def toSQLId(parts: Seq[String]): String
- Definition Classes
- DataTypeErrorsBase
- def toSQLId(parts: String): String
- Definition Classes
- DataTypeErrorsBase
- def toSQLStmt(text: String): String
- Definition Classes
- DataTypeErrorsBase
- def toSQLType(t: AbstractDataType): String
- Definition Classes
- DataTypeErrorsBase
- def toSQLType(text: String): String
- Definition Classes
- DataTypeErrorsBase
- def toSQLValue(v: Any, t: DataType): String
- Definition Classes
- QueryErrorsBase
- def toSQLValue(value: Double): String
- Definition Classes
- DataTypeErrorsBase
- def toSQLValue(value: Float): String
- Definition Classes
- DataTypeErrorsBase
- def toSQLValue(value: Long): String
- Definition Classes
- DataTypeErrorsBase
- def toSQLValue(value: Int): String
- Definition Classes
- DataTypeErrorsBase
- def toSQLValue(value: Short): String
- Definition Classes
- DataTypeErrorsBase
- def toSQLValue(value: UTF8String): String
- Definition Classes
- DataTypeErrorsBase
- def toSQLValue(value: String): String
- Definition Classes
- DataTypeErrorsBase
- def toString(): String
- Definition Classes
- AnyRef → Any
- def trimAliases(e: Expression): Expression
- Attributes
- protected
- Definition Classes
- AliasHelper
- def trimNonTopLevelAliases[T <: Expression](e: T): T
- Attributes
- protected
- Definition Classes
- AliasHelper
- 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 withResolvedChildren(unresolvedExpression: Expression, resolveChild: (Expression) => Expression): Expression
Resolves generic Expression children and returns its copy with children resolved.
Resolves generic Expression children and returns its copy with children resolved.
We avoid extra method calls here, because
resolveChildusually recurses deeply into resolution, and expression trees may be quite deep.- Attributes
- protected
- Definition Classes
- ResolvesExpressionChildren
- def withResolvedChildren(unresolvedExpression: QuaternaryExpression, resolveChild: (Expression) => Expression): Expression
Resolves QuaternaryExpression children and returns its copy with children resolved.
Resolves QuaternaryExpression children and returns its copy with children resolved.
- Attributes
- protected
- Definition Classes
- ResolvesExpressionChildren
- def withResolvedChildren(unresolvedExpression: TernaryExpression, resolveChild: (Expression) => Expression): Expression
Resolves TernaryExpression children and returns its copy with children resolved.
Resolves TernaryExpression children and returns its copy with children resolved.
- Attributes
- protected
- Definition Classes
- ResolvesExpressionChildren
- def withResolvedChildren(unresolvedExpression: BinaryExpression, resolveChild: (Expression) => Expression): Expression
Resolves BinaryExpression children and returns its copy with children resolved.
Resolves BinaryExpression children and returns its copy with children resolved.
- Attributes
- protected
- Definition Classes
- ResolvesExpressionChildren
- def withResolvedChildren(unresolvedExpression: UnaryExpression, resolveChild: (Expression) => Expression): Expression
Resolves UnaryExpression children and returns its copy with children resolved.
Resolves UnaryExpression children and returns its copy with children resolved.
- Attributes
- protected
- Definition Classes
- ResolvesExpressionChildren
- def withSQLConf[T](pairs: (String, String)*)(f: => T): T
Sets all SQL configurations specified in
pairs, callsf, and then restores all SQL configurations.Sets all SQL configurations specified in
pairs, callsf, and then restores all SQL configurations.- Attributes
- protected
- Definition Classes
- SQLConfHelper
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)