Skip to content

Window Unary Logical Operator

Window is a spark-sql-LogicalPlan.md#UnaryNode[unary logical operator] that...FIXME

Window is <> when:

[[output]] When requested for <>, Window requests the <> logical operator for them and adds the <> of the <>.

NOTE: Window logical operator is a subject of pruning unnecessary window expressions in <> logical optimization and collapsing window operators in <> logical optimization.

Note

Window logical operator is resolved to a WindowExec in BasicOperators execution planning strategy.

=== [[catalyst-dsl]] Catalyst DSL -- window Operator

[source, scala]

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


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

[source, scala]

// FIXME: DEMO

=== [[creating-instance]] Creating Window Instance

Window takes the following when created:

  • [[windowExpression]] Window expressions/NamedExpression.md[named expressions]
  • [[partitionSpec]] Window partition specification expressions/Expression.md[expressions]
  • [[orderSpec]] Window order specification (as a collection of SortOrder expressions)
  • [[child]] Child <>

=== [[windowOutputSet]] Creating AttributeSet with Window Expression Attributes -- windowOutputSet Method

[source, scala]

windowOutputSet: AttributeSet

windowOutputSet simply creates a AttributeSet with the <> of the <>.

[NOTE]

windowOutputSet is used when:

  • ColumnPruning logical optimization is <> (on a <> operator with a Window as the <>)

* CollapseWindow logical optimization is <> (on a Window operator with another Window operator as the <>)