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
EliminateOuterJoin
logical optimization is executedOptimizeOneRowRelationSubquery
logical optimization is executedSubquery
is created (from an expression)Filter
logical 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:
SubqueryExpression
is requested to hasInOrCorrelatedExistsSubquery, hasCorrelatedSubqueryScalarSubquery
is requested to hasCorrelatedScalarSubqueryMergeScalarSubqueries
logical optimization is executed