Expand Unary Logical Operator¶
Expand is a unary logical operator that represents Cube, Rollup, GroupingSets and TimeWindow logical operators after they have been resolved at analysis phase.
Creating Instance¶
Expand takes the following to be created:
- Projections (
Seq[Seq[Expression]]) - Output Attributes
- Child LogicalPlan
Expand is created when:
ResolveUnpivotlogical resolution rule is executed (to resolveUnpivotexpression)TimeWindowinglogical resolution rule is executed (to resolve TimeWindow expressions)RewriteUpdateTablelogical resolution rule is executed (tobuildDeletesAndInserts)Expandis requested to apply
Creating Expand¶
apply(
groupingSetsAttrs: Seq[Seq[Attribute]],
groupByAliases: Seq[Alias],
groupByAttrs: Seq[Attribute],
gid: Attribute,
child: LogicalPlan): Expand
apply...FIXME
apply is used when:
- ResolveGroupingAnalytics logical analysis rule is executed
Analysis Phase¶
Expand logical operator is resolved at analysis phase in the following logical evaluation rules:
- ResolveGroupingAnalytics (for
Cube,Rollup, GroupingSets logical operators) ResolveUnpivotRewriteUpdateTableTimeWindowing(for TimeWindow logical operator)
Physical Planning¶
Expand logical operator is resolved to ExpandExec physical operator in BasicOperators execution planning strategy.