Skip to content

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:

Expand is created when:

  • ResolveUnpivot logical resolution rule is executed (to resolve Unpivot expression)
  • TimeWindowing logical resolution rule is executed (to resolve TimeWindow expressions)
  • RewriteUpdateTable logical resolution rule is executed (to buildDeletesAndInserts)
  • 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:

Analysis Phase

Expand logical operator is resolved at analysis phase in the following logical evaluation rules:

Physical Planning

Expand logical operator is resolved to ExpandExec physical operator in BasicOperators execution planning strategy.