org.apache.spark.sql.catalyst

analysis

package analysis

Provides a logical query plan Analyzer and supporting classes for performing analysis. Analysis consists of translating UnresolvedAttributes and UnresolvedRelations into fully typed objects using information in a schema Catalog.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. analysis
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. implicit class AnalysisErrorAt extends AnyRef

  2. class Analyzer extends RuleExecutor[LogicalPlan] with HiveTypeCoercion 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.

  3. trait Catalog extends AnyRef

    An interface for looking up relations by name.

    An interface for looking up relations by name. Used by an Analyzer.

  4. trait CheckAnalysis extends AnyRef

    Throws user facing errors when passed invalid queries that fail to analyze.

  5. trait FunctionRegistry extends AnyRef

    A catalog for looking up user defined functions, used by an Analyzer.

  6. trait HiveTypeCoercion extends AnyRef

    A collection of Rules that can be used to coerce differing types that participate in operations into compatible ones.

    A collection of Rules that can be used to coerce differing types that participate in operations into compatible ones. Most of these rules are based on Hive semantics, but they do not introduce any dependencies on the hive codebase. For this reason they remain in Catalyst until we have a more standard set of coercions.

  7. case class MultiAlias(child: Expression, names: Seq[String]) extends Attribute with UnaryNode[Expression] with Product with Serializable

    Used to assign new names to Generator's output, such as hive udtf.

    Used to assign new names to Generator's output, such as hive udtf. For example the SQL expression "stack(2, key, value, key, value) as (a, b)" could be represented as follows: MultiAlias(stack_function, Seq(a, b))

    child

    the computation being performed

    names

    the names to be associated with each output of computing child.

  8. trait MultiInstanceRelation extends AnyRef

    A trait that should be mixed into query operators where an single instance might appear multiple times in a logical query plan.

    A trait that should be mixed into query operators where an single instance might appear multiple times in a logical query plan. It is invalid to have multiple copies of the same attribute produced by distinct operators in a query tree as this breaks the guarantee that expression ids, which are used to differentiate attributes, are unique.

    During analysis, operators that include this trait may be asked to produce a new version of itself with globally unique expression ids.

  9. class NoSuchTableException extends Exception

    Thrown by a catalog when a table cannot be found.

    Thrown by a catalog when a table cannot be found. The analzyer will rethrow the exception as an AnalysisException with the correct position information.

  10. trait OverrideCatalog extends Catalog

    A trait that can be mixed in with other Catalogs allowing specific tables to be overridden with new logical plans.

    A trait that can be mixed in with other Catalogs allowing specific tables to be overridden with new logical plans. This can be used to bind query result to virtual tables, or replace tables with in-memory cached versions. Note that the set of overrides is stored in memory and thus lost when the JVM exits.

  11. trait OverrideFunctionRegistry extends FunctionRegistry

  12. case class ResolvedStar(expressions: Seq[NamedExpression]) extends Attribute with Star with Product with Serializable

    Represents all the resolved input attributes to a given relational operator.

    Represents all the resolved input attributes to a given relational operator. This is used in the data frame DSL.

    expressions

    Expressions to expand.

  13. type Resolver = (String, String) ⇒ Boolean

    Resolver should return true if the first string refers to the same entity as the second string.

    Resolver should return true if the first string refers to the same entity as the second string. For example, by using case insensitive equality.

  14. class SimpleCatalog extends Catalog

  15. class SimpleFunctionRegistry extends FunctionRegistry

  16. trait Star extends Attribute with LeafNode[Expression]

    Represents all of the input attributes to a given relational operator, for example in "SELECT * FROM ...".

    Represents all of the input attributes to a given relational operator, for example in "SELECT * FROM ...". A Star gets automatically expanded during analysis.

  17. class StringKeyHashMap[T] extends AnyRef

  18. case class UnresolvedAttribute(name: String) extends Attribute with LeafNode[Expression] with Product with Serializable

    Holds the name of an attribute that has yet to be resolved.

  19. class UnresolvedException[TreeType <: TreeNode[_]] extends TreeNodeException[TreeType]

    Thrown when an invalid attempt is made to access a property of a tree that has yet to be fully resolved.

  20. case class UnresolvedFunction(name: String, children: Seq[Expression]) extends Expression with Product with Serializable

  21. case class UnresolvedGetField(child: Expression, fieldName: String) extends UnaryExpression with Product with Serializable

  22. case class UnresolvedRelation(tableIdentifier: Seq[String], alias: Option[String] = None) extends LeafNode with Product with Serializable

    Holds the name of a relation that has yet to be looked up in a Catalog.

  23. case class UnresolvedStar(table: Option[String]) extends Attribute with Star with Product with Serializable

    Represents all of the input attributes to a given relational operator, for example in "SELECT * FROM ...".

    Represents all of the input attributes to a given relational operator, for example in "SELECT * FROM ...".

    table

    an optional table that should be the target of the expansion. If omitted all tables' columns are produced.

Value Members

  1. object EliminateSubQueries extends Rule[LogicalPlan]

    Removes Subquery operators from the plan.

    Removes Subquery operators from the plan. Subqueries are only required to provide scoping information for attributes and can be removed once analysis is complete.

  2. object EmptyCatalog extends Catalog

    A trivial catalog that returns an error when a relation is requested.

    A trivial catalog that returns an error when a relation is requested. Used for testing when all relations are already filled in and the analyser needs only to resolve attribute references.

  3. object EmptyFunctionRegistry extends FunctionRegistry

    A trivial catalog that returns an error when a function is requested.

    A trivial catalog that returns an error when a function is requested. Used for testing when all functions are already filled in and the analyser needs only to resolve attribute references.

  4. object HiveTypeCoercion

  5. object SimpleAnalyzer extends Analyzer

    A trivial Analyzer with an EmptyCatalog and EmptyFunctionRegistry.

    A trivial Analyzer with an EmptyCatalog and EmptyFunctionRegistry. Used for testing when all relations are already filled in and the analyser needs only to resolve attribute references.

  6. object StringKeyHashMap

    Build a map with String type of key, and it also supports either key case sensitive or insensitive.

    Build a map with String type of key, and it also supports either key case sensitive or insensitive. TODO move this into util folder?

  7. val caseInsensitiveResolution: (String, String) ⇒ Boolean

  8. val caseSensitiveResolution: (String, String) ⇒ Boolean

  9. def withPosition[A](t: TreeNode[_])(f: ⇒ A): A

    Catches any AnalysisExceptions thrown by f and attaches t's position if any.

Inherited from AnyRef

Inherited from Any

Ungrouped