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.

FIXME Examples for
1. Cube
2. Rollup
3. GroupingSets
4. See TimeWindow

val q = ...

scala> println(q.queryExecution.logical.numberedTreeString)
...
Note
Expand logical operator is translated to ExpandExec physical operator in BasicOperators execution planning strategy.
Table 1. Expand’s Properties (in alphabetical order)
Name Description

references

AttributeSet from projections

validConstraints

Empty set of expressions

Analysis Phase

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

Note
Aggregate → (Cube|Rollup|GroupingSets) → constructAggregate → constructExpand
val spark: SparkSession = ...
// using q from the example above
val plan = q.queryExecution.logical

scala> println(plan.numberedTreeString)
...FIXME

Rule-Based Logical Optimization Phase

computeStats Method

Caution
FIXME
Note
computeStats is a part of LogicalPlan Contract to calculating statistics estimates (for cost-based optimizer).

Creating Expand Instance

Expand takes the following when created:

results matching ""

    No results matching ""