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:
- EliminateResolvedHint logical optimization is executed (and pullHintsIntoSubqueries)
withNewHint¶
withNewHint(
hint: Option[HintInfo]): SubqueryExpression
Used when:
- EliminateResolvedHint logical optimization is executed (and pullHintsIntoSubqueries)
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¶
- DynamicPruningSubquery
- Exists
LateralSubquery- ListQuery
- ScalarSubquery
Creating Instance¶
SubqueryExpression takes the following to be created:
- Subquery logical plan
- Outer Attributes (Expressions)
- Expression ID
- Join Condition (Expressions)
- HintInfo
Abstract Class
SubqueryExpression is an abstract class and cannot be created directly. It is created indirectly for the concrete SubqueryExpressions.
References¶
references is...FIXME
resolved¶
resolved is true when all of the following hold:
hasInOrCorrelatedExistsSubquery¶
hasInOrCorrelatedExistsSubquery(
e: Expression): Boolean
hasInOrCorrelatedExistsSubquery...FIXME
hasInOrCorrelatedExistsSubquery is used when:
- RewritePredicateSubquery logical optimization is executed
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
EliminateOuterJoinlogical optimization is executedOptimizeOneRowRelationSubquerylogical optimization is executedSubqueryis created (from an expression)Filterlogical operator is requested forvalidConstraints
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:
SubqueryExpressionis requested to hasInOrCorrelatedExistsSubquery, hasCorrelatedSubqueryScalarSubqueryis requested to hasCorrelatedScalarSubqueryMergeScalarSubquerieslogical optimization is executed