Skip to content


WindowFunctionFrame is a <> for...FIXME

[[implementations]] .WindowFunctionFrame's Implementations [width="100%",cols="1,2",options="header"] |=== | Name | Description

[[SlidingWindowFunctionFrame]] SlidingWindowFunctionFrame

=== [[UnboundedWindowFunctionFrame]] UnboundedWindowFunctionFrame

UnboundedWindowFunctionFrame is a <> that gives the same value for every row in a partition.

UnboundedWindowFunctionFrame is <> for[AggregateFunctions] (in AggregateExpressions) or[AggregateWindowFunctions] with no frame defined (i.e. no rowsBetween or rangeBetween) that boils down to using the[entire partition frame].

[[UnboundedWindowFunctionFrame-creating-instance]] UnboundedWindowFunctionFrame takes the following when created:

  • [[UnboundedWindowFunctionFrame-target]] Target InternalRow
  • [[UnboundedWindowFunctionFrame-processor]][AggregateProcessor]

==== [[UnboundedWindowFunctionFrame-prepare]] prepare Method

[source, scala]

prepare(rows: ExternalAppendOnlyUnsafeRowArray): Unit

prepare requests <> to[initialize] passing in the number of UnsafeRows in the input ExternalAppendOnlyUnsafeRowArray.

prepare then requests ExternalAppendOnlyUnsafeRowArray to[generate an interator].

In the end, prepare requests <> to[update] passing in every UnsafeRow in the iterator one at a time.

==== [[UnboundedWindowFunctionFrame-write]] write Method

[source, scala]

write(index: Int, current: InternalRow): Unit

write simply requests <> to[evaluate] the <>.

=== [[contract]] WindowFunctionFrame Contract

[source, scala]

package org.apache.spark.sql.execution.window

abstract class WindowFunctionFrame { def prepare(rows: ExternalAppendOnlyUnsafeRowArray): Unit def write(index: Int, current: InternalRow): Unit }

NOTE: WindowFunctionFrame is a private[window] contract.

.WindowFunctionFrame Contract [cols="1,2",options="header",width="100%"] |=== | Method | Description

| [[prepare]] prepare | Used exclusively when WindowExec operator[fetches all UnsafeRows for a partition] (passing in[ExternalAppendOnlyUnsafeRowArray] with all UnsafeRows).

| [[write]] write | Used exclusively when the[Iterator[InternalRow]] (from[executing] WindowExec) is[requested a next row]. |===

Last update: 2020-11-07