class FunctionResolver extends TreeNodeResolver[UnresolvedFunction, Expression] with ProducesUnresolvedSubtree
A resolver for UnresolvedFunctions that resolves functions to concrete Expressions. It resolves the children of the function first by calling ExpressionResolver.resolve on them if they are not UnresolvedStars. If the children are UnresolvedStars, it resolves them using ExpressionResolver.resolveStar. Examples are following:
- Function doesn't contain any UnresolvedStar:
SELECT ARRAY(col1) FROM VALUES (1);it is resolved only using ExpressionResolver.resolve.
- Function contains UnresolvedStar:
SELECT ARRAY(*) FROM VALUES (1);it is resolved using ExpressionResolver.resolveStar.
After resolving the function with FunctionResolution.resolveFunction, performs further resolution in following cases:
- result of FunctionResolution.resolveFunction is ExpressionWithRandomSeed in which case it is necessary to initialize the random seed.
- result of FunctionResolution.resolveFunction is InheritAnalysisRules, in which case it is necessary to resolve its replacement expression.
- result of FunctionResolution.resolveFunction is AggregateExpression or BinaryArithmetic, in which case it is necessary to perform further resolution and checks on its children.
Finally apply type coercion to the result of previous step and in case that the resulting expression is TimeZoneAwareExpression, apply timezone.
- Alphabetic
- By Inheritance
- FunctionResolver
- ProducesUnresolvedSubtree
- ResolvesExpressionChildren
- TreeNodeResolver
- QueryErrorsBase
- DataTypeErrorsBase
- SQLConfHelper
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new FunctionResolver(expressionResolver: ExpressionResolver, timezoneAwareExpressionResolver: TimezoneAwareExpressionResolver, functionResolution: FunctionResolution, aggregateExpressionResolver: AggregateExpressionResolver, binaryArithmeticResolver: BinaryArithmeticResolver)
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
- 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 hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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
- Definition Classes
- DataTypeErrorsBase
- def resolve(unresolvedFunction: UnresolvedFunction): Expression
Main method used to resolve an UnresolvedFunction.
Main method used to resolve an UnresolvedFunction. It resolves it in the following steps:
- If the function is
count(*)it is replaced withcount(1)(please check normalizeCountExpression documentation for more details). Otherwise, we resolve the children of it. - Resolve the function using FunctionResolution.resolveFunction.
- If the result from previous step is an AggregateExpression, BinaryArithmetic or InheritAnalysisRules, perform further resolution on its children. If the result is an ExpressionWithRandomSeed, initialize the seed.
- Apply TypeCoercion rules to the result of previous step. In case that the resulting expression of the previous step is BinaryArithmetic, skip this one as type coercion is already applied.
- Apply timezone, if the resulting expression is TimeZoneAwareExpression.
- Definition Classes
- FunctionResolver → TreeNodeResolver
- If the function is
- 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
- 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[ExpressionType <: Expression](unresolvedExpression: ExpressionType, resolveChild: (Expression) => Expression): ExpressionType
Resolves generic Expression children and returns its copy with children resolved.
Resolves generic Expression children and returns its copy with children resolved.
- Attributes
- protected
- Definition Classes
- ResolvesExpressionChildren
- def withResolvedSubtree(expression: Expression, expressionResolver: (Expression) => Expression)(body: => Expression): Expression
Helper method used to resolve a subtree that is generated as part of the resolution of some node.
Helper method used to resolve a subtree that is generated as part of the resolution of some node. Method ensures that the downwards traversal never visits previously resolved nodes by tracking the limits of the traversal with a tag. Invokes a resolver callback to resolve children, but DOES NOT resolve the root of the subtree.
- Attributes
- protected
- Definition Classes
- ProducesUnresolvedSubtree
- 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)