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:
ResolveUnpivot
logical resolution rule is executed (to resolveUnpivot
expression)TimeWindowing
logical resolution rule is executed (to resolve TimeWindow expressions)RewriteUpdateTable
logical resolution rule is executed (tobuildDeletesAndInserts
)Expand
is 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) ResolveUnpivot
RewriteUpdateTable
TimeWindowing
(for TimeWindow logical operator)
Physical Planning¶
Expand
logical operator is resolved to ExpandExec physical operator in BasicOperators execution planning strategy.