Class

org.apache.spark.sql.catalyst.analysis

Analyzer

Related Doc: package analysis

Permalink

class Analyzer extends RuleExecutor[LogicalPlan] with CheckAnalysis

Provides a logical query plan analyzer, which translates UnresolvedAttributes and UnresolvedRelations into fully typed objects using information in a schema Catalog and a FunctionRegistry.

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Analyzer
  2. CheckAnalysis
  3. RuleExecutor
  4. Logging
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Analyzer(catalog: Catalog, registry: FunctionRegistry, conf: CatalystConf, maxIterations: Int = 100)

    Permalink

Type Members

  1. case class Batch(name: String, strategy: Strategy, rules: Rule[TreeType]*) extends Product with Serializable

    Permalink

    A batch of rules.

    A batch of rules.

    Attributes
    protected
    Definition Classes
    RuleExecutor
  2. case class FixedPoint(maxIterations: Int) extends Strategy with Product with Serializable

    Permalink

    A strategy that runs until fix point or maxIterations times, whichever comes first.

    A strategy that runs until fix point or maxIterations times, whichever comes first.

    Definition Classes
    RuleExecutor
  3. abstract class Strategy extends AnyRef

    Permalink

    An execution strategy for rules that indicates the maximum number of executions.

    An execution strategy for rules that indicates the maximum number of executions. If the execution reaches fix point (i.e. converge) before maxIterations, it will stop.

    Definition Classes
    RuleExecutor

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object CTESubstitution extends Rule[LogicalPlan]

    Permalink

    Substitute child plan with cte definitions

  5. object ExtractWindowExpressions extends Rule[LogicalPlan]

    Permalink

    Extracts WindowExpressions from the projectList of a Project operator and aggregateExpressions of an Aggregate operator and creates individual Window operators for every distinct WindowSpecDefinition.

    Extracts WindowExpressions from the projectList of a Project operator and aggregateExpressions of an Aggregate operator and creates individual Window operators for every distinct WindowSpecDefinition.

    This rule handles three cases:

    • A Project having WindowExpressions in its projectList;
    • An Aggregate having WindowExpressions in its aggregateExpressions.
    • An Filter->Aggregate pattern representing GROUP BY with a HAVING clause and the Aggregate has WindowExpressions in its aggregateExpressions. Note: If there is a GROUP BY clause in the query, aggregations and corresponding filters (expressions in the HAVING clause) should be evaluated before any WindowExpression. If a query has SELECT DISTINCT, the DISTINCT part should be evaluated after all WindowExpressions.

    For every case, the transformation works as follows: 1. For a list of Expressions (a projectList or an aggregateExpressions), partitions it two lists of Expressions, one for all WindowExpressions and another for all regular expressions. 2. For all WindowExpressions, groups them based on their WindowSpecDefinitions. 3. For every distinct WindowSpecDefinition, creates a Window operator and inserts it into the plan tree.

  6. object GlobalAggregates extends Rule[LogicalPlan]

    Permalink

    Turns projections that contain aggregate expressions into aggregations.

  7. object Once extends Strategy with Product with Serializable

    Permalink

    A strategy that only runs once.

    A strategy that only runs once.

    Definition Classes
    RuleExecutor
  8. object PullOutNondeterministic extends Rule[LogicalPlan]

    Permalink

    Pulls out nondeterministic expressions from LogicalPlan which is not Project or Filter, put them into an inner Project and finally project them away at the outer Project.

  9. object ResolveAggregateFunctions extends Rule[LogicalPlan]

    Permalink

    This rule finds aggregate expressions that are not in an aggregate operator.

    This rule finds aggregate expressions that are not in an aggregate operator. For example, those in a HAVING clause or ORDER BY clause. These expressions are pushed down to the underlying aggregate operator and then projected away after the original operator.

  10. object ResolveAliases extends Rule[LogicalPlan]

    Permalink

    Replaces UnresolvedAliass with concrete aliases.

  11. object ResolveFunctions extends Rule[LogicalPlan]

    Permalink

    Replaces UnresolvedFunctions with concrete Expressions.

  12. object ResolveGenerate extends Rule[LogicalPlan]

    Permalink

    Rewrites table generating expressions that either need one or more of the following in order to be resolved:

    Rewrites table generating expressions that either need one or more of the following in order to be resolved:

    • concrete attribute references for their output.
    • to be relocated from a SELECT clause (i.e. from a Project) into a Generate).

    Names for the output Attributes are extracted from Alias or MultiAlias expressions that wrap the Generator. If more than one Generator is found in a Project, an AnalysisException is throw.

  13. object ResolveGroupingAnalytics extends Rule[LogicalPlan]

    Permalink
  14. object ResolveReferences extends Rule[LogicalPlan]

    Permalink

    Replaces UnresolvedAttributes with concrete AttributeReferences from a logical plan node's children.

  15. object ResolveRelations extends Rule[LogicalPlan]

    Permalink

    Replaces UnresolvedRelations with concrete relations from the catalog.

  16. object ResolveSortReferences extends Rule[LogicalPlan]

    Permalink

    In many dialects of SQL it is valid to sort by attributes that are not present in the SELECT clause.

    In many dialects of SQL it is valid to sort by attributes that are not present in the SELECT clause. This rule detects such queries and adds the required attributes to the original projection, so that they will be available during sorting. Another projection is added to remove these attributes after sorting.

  17. object WindowsSubstitution extends Rule[LogicalPlan]

    Permalink

    Substitute child plan with WindowSpecDefinitions.

  18. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  19. lazy val batches: Seq[Batch]

    Permalink

    Defines a sequence of rule batches, to be overridden by the implementation.

    Defines a sequence of rule batches, to be overridden by the implementation.

    Definition Classes
    AnalyzerRuleExecutor
  20. def checkAnalysis(plan: LogicalPlan): Unit

    Permalink
    Definition Classes
    CheckAnalysis
  21. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. def containsMultipleGenerators(exprs: Seq[Expression]): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    CheckAnalysis
  23. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  24. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  25. def execute(plan: LogicalPlan): LogicalPlan

    Permalink

    Executes the batches of rules defined by the subclass.

    Executes the batches of rules defined by the subclass. The batches are executed serially using the defined execution strategy. Within each batch, rules are also executed serially.

    Definition Classes
    RuleExecutor
  26. val extendedCheckRules: Seq[(LogicalPlan) ⇒ Unit]

    Permalink

    Override to provide additional checks for correct analysis.

    Override to provide additional checks for correct analysis. These rules will be evaluated after our built-in check rules.

    Definition Classes
    CheckAnalysis
  27. val extendedResolutionRules: Seq[Rule[LogicalPlan]]

    Permalink

    Override to provide additional rules for the "Resolution" batch.

  28. def failAnalysis(msg: String): Nothing

    Permalink
    Attributes
    protected
    Definition Classes
    CheckAnalysis
  29. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  30. val fixedPoint: FixedPoint

    Permalink
  31. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  32. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  33. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  34. def isTraceEnabled(): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  35. def log: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  36. def logDebug(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  37. def logDebug(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  38. def logError(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  39. def logError(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  40. def logInfo(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  41. def logInfo(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  42. def logName: String

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  43. def logTrace(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  44. def logTrace(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  45. def logWarning(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  46. def logWarning(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  47. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  48. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  49. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  50. def resolver: Resolver

    Permalink
  51. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  52. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  53. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  55. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from CheckAnalysis

Inherited from RuleExecutor[LogicalPlan]

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped