Window Unary Logical Operator

Window is a unary logical operator that…​FIXME

Window is created when:

  • ExtractWindowExpressions logical resolution rule is executed

  • CleanupAliases logical analysis rule is executed

When requested for output schema attributes, Window requests the child logical operator for them and adds the attributes of the window named expressions.

Note
Window logical operator is a subject of pruning unnecessary window expressions in ColumnPruning logical optimization and collapsing window operators in CollapseWindow logical optimization.
Note
Window logical operator is resolved to a WindowExec in BasicOperators execution planning strategy.

Catalyst DSL — window Operator

window(
  windowExpressions: Seq[NamedExpression],
  partitionSpec: Seq[Expression],
  orderSpec: Seq[SortOrder]): LogicalPlan

window operator in Catalyst DSL creates a Window logical operator, e.g. for testing or Spark SQL internals exploration.

// FIXME: DEMO

Creating Window Instance

Window takes the following when created:

Creating AttributeSet with Window Expression Attributes — windowOutputSet Method

windowOutputSet: AttributeSet

windowOutputSet simply creates a AttributeSet with the attributes of the window named expressions.

Note

windowOutputSet is used when:

  • ColumnPruning logical optimization is executed (on a Project operator with a Window as the child operator)

  • CollapseWindow logical optimization is executed (on a Window operator with another Window operator as the child)

results matching ""

    No results matching ""