Packages

class AggregateResolver extends TreeNodeResolver[Aggregate, LogicalPlan] with AliasHelper

Resolves an Aggregate by resolving its child, aggregate expressions and grouping expressions. Updates the NameScopeStack with its output and performs validation related to Aggregate resolution.

Linear Supertypes
AliasHelper, TreeNodeResolver[Aggregate, LogicalPlan], QueryErrorsBase, DataTypeErrorsBase, SQLConfHelper, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AggregateResolver
  2. AliasHelper
  3. TreeNodeResolver
  4. QueryErrorsBase
  5. DataTypeErrorsBase
  6. SQLConfHelper
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new AggregateResolver(operatorResolver: Resolver, expressionResolver: ExpressionResolver)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  6. 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
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. def getAliasMap(exprs: Iterable[NamedExpression]): AttributeMap[Alias]
    Attributes
    protected
    Definition Classes
    AliasHelper
  10. def getAliasMap(plan: Aggregate): AttributeMap[Alias]
    Attributes
    protected
    Definition Classes
    AliasHelper
  11. def getAliasMap(plan: Project): AttributeMap[Alias]
    Attributes
    protected
    Definition Classes
    AliasHelper
  12. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  13. def getQueryContext(context: QueryContext): Array[QueryContext]
    Definition Classes
    DataTypeErrorsBase
  14. def getSummary(sqlContext: QueryContext): String
    Definition Classes
    DataTypeErrorsBase
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. 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
  18. 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()
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  22. def ordinalNumber(i: Int): String
    Definition Classes
    QueryErrorsBase
  23. def quoteByDefault(elem: String): String
    Attributes
    protected[sql]
    Definition Classes
    DataTypeErrorsBase
  24. 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
  25. 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
  26. def resolve(unresolvedAggregate: Aggregate): LogicalPlan

    Resolve Aggregate operator.

    Resolve Aggregate operator.

    1. Resolve the child (inline table). 2. Clear NameScope.availableAliases. Those are only relevant for the immediate aggregate expressions for output prioritization to work correctly in NameScope.tryResolveMultipartNameByOutput. 3. Resolve aggregate expressions using ExpressionResolver.resolveAggregateExpressions and set NameScope.ordinalReplacementExpressions for grouping expressions resolution. 4. If there's just one UnresolvedAttribute with a single-part name "ALL", expand it using aggregate expressions which don't contain aggregate functions. There should not exist a column with that name in the lower operator's output, otherwise it takes precedence. 5. Resolve grouping expressions using ExpressionResolver.resolveGroupingExpressions. This includes alias references to aggregate expressions, which is done in NameScope.resolveMultipartName and replacing UnresolvedOrdinals with corresponding expressions from aggregate list, done in OrdinalResolver. 6. Remove all the unnecessary Aliases from the grouping (all the aliases) and aggregate (keep the outermost one) expressions. This is needed to stay compatible with the fixed-point implementation. For example:

    SELECT timestamp(col1:str) FROM VALUES('a') GROUP BY timestamp(col1:str);

    Here we end up having inner Aliases in both the grouping and aggregate expressions lists which are uncomparable because they have different expression IDs (thus we have to strip them).

    If the resulting Aggregate contains lateral columns references, delegate the resolution of these columns to LateralColumnAliasResolver.handleLcaInAggregate. Otherwise, validate the Aggregate using the ExprUtils.assertValidAggregation, update the scopes with the output of Aggregate and return the result.

    Definition Classes
    AggregateResolver → TreeNodeResolver
  27. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  28. def toDSOption(option: String): String
    Definition Classes
    DataTypeErrorsBase
  29. def toSQLConf(conf: String): String
    Definition Classes
    DataTypeErrorsBase
  30. def toSQLConfVal(conf: String): String
    Definition Classes
    QueryErrorsBase
  31. def toSQLExpr(e: Expression): String
    Definition Classes
    QueryErrorsBase
  32. def toSQLId(parts: Seq[String]): String
    Definition Classes
    DataTypeErrorsBase
  33. def toSQLId(parts: String): String
    Definition Classes
    DataTypeErrorsBase
  34. def toSQLStmt(text: String): String
    Definition Classes
    DataTypeErrorsBase
  35. def toSQLType(t: AbstractDataType): String
    Definition Classes
    DataTypeErrorsBase
  36. def toSQLType(text: String): String
    Definition Classes
    DataTypeErrorsBase
  37. def toSQLValue(v: Any, t: DataType): String
    Definition Classes
    QueryErrorsBase
  38. def toSQLValue(value: Double): String
    Definition Classes
    DataTypeErrorsBase
  39. def toSQLValue(value: Float): String
    Definition Classes
    DataTypeErrorsBase
  40. def toSQLValue(value: Long): String
    Definition Classes
    DataTypeErrorsBase
  41. def toSQLValue(value: Int): String
    Definition Classes
    DataTypeErrorsBase
  42. def toSQLValue(value: Short): String
    Definition Classes
    DataTypeErrorsBase
  43. def toSQLValue(value: UTF8String): String
    Definition Classes
    DataTypeErrorsBase
  44. def toSQLValue(value: String): String
    Definition Classes
    DataTypeErrorsBase
  45. def toString(): String
    Definition Classes
    AnyRef → Any
  46. def trimAliases(e: Expression): Expression
    Attributes
    protected
    Definition Classes
    AliasHelper
  47. def trimNonTopLevelAliases[T <: Expression](e: T): T
    Attributes
    protected
    Definition Classes
    AliasHelper
  48. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  49. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  50. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  51. def withSQLConf[T](pairs: (String, String)*)(f: => T): T

    Sets all SQL configurations specified in pairs, calls f, and then restores all SQL configurations.

    Sets all SQL configurations specified in pairs, calls f, and then restores all SQL configurations.

    Attributes
    protected
    Definition Classes
    SQLConfHelper

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AliasHelper

Inherited from QueryErrorsBase

Inherited from DataTypeErrorsBase

Inherited from SQLConfHelper

Inherited from AnyRef

Inherited from Any

Ungrouped