Skip to content

SubqueryExpression Expressions

SubqueryExpression is an extension of the PlanExpression abstraction for subquery expressions with logical plans (for a subquery).

Contract

hint

hint: Option[HintInfo]

Used when:

withNewHint

withNewHint(
  hint: Option[HintInfo]): SubqueryExpression

Used when:

withNewPlan

withNewPlan(
  plan: LogicalPlan): SubqueryExpression

Note

withNewPlan is part of the PlanExpression abstraction and is defined as follows:

withNewPlan(plan: T): PlanExpression[T]

The purpose of this override method is to change the input and output generic types to the concrete LogicalPlan and SubqueryExpression, respectively.

Implementations

Creating Instance

SubqueryExpression takes the following to be created:

Abstract Class

SubqueryExpression is an abstract class and cannot be created directly. It is created indirectly for the concrete SubqueryExpressions.

References

Expression
references: AttributeSet

references is part of the Expression abstraction.

references is...FIXME

resolved

Expression
resolved: Boolean

resolved is part of the Expression abstraction.

resolved is true when all of the following hold:

hasInOrCorrelatedExistsSubquery

hasInOrCorrelatedExistsSubquery(
  e: Expression): Boolean

hasInOrCorrelatedExistsSubquery...FIXME


hasInOrCorrelatedExistsSubquery is used when:

hasCorrelatedSubquery

hasCorrelatedSubquery(
  e: Expression): Boolean

hasCorrelatedSubquery is true when the given Expression contains a correlated subquery (there is a SubqueryExpression with isCorrelated flag enabled).

Correlated Subquery

Correlated Subquery is a subquery with outer references.


hasCorrelatedSubquery is used when:

  • CombineUnions logical optimization is executed
  • EliminateOuterJoin logical optimization is executed
  • OptimizeOneRowRelationSubquery logical optimization is executed
  • Subquery is created (from an expression)
  • Filter logical operator is requested for validConstraints

hasSubquery

hasSubquery(
  e: Expression): Boolean

hasSubquery is true when the given Expression contains a subquery (there is a SubqueryExpression).

isCorrelated

isCorrelated: Boolean

isCorrelated is true when there is at least one outer attribute (among the outerAttrs).


isCorrelated is used when: