final class WindowSpec
    implements WindowSpecification
    uses Snapshot
Public API: explicitly declared with @visibility public.

A parenthesized window specification: an optional window it refines, a partitioning, an ordering and a frame.

Rule: MYSQL-WINDOW-SPEC-001. The expressions are derived at the position of the window. The base window is a window of the WINDOW clause, which the query family resolves. A GROUPS frame and an EXCLUDE clause are accepted by the grammar and rejected by the server (ER_NOT_SUPPORTED_YET). Terminates: the parts are strict parts. Source: https://dev.mysql.com/doc/refman/8.4/en/window-functions-usage.html, https://dev.mysql.com/doc/refman/8.4/en/window-functions-named-windows.html. Status: Implemented.

Holding the parts of a windowdoctest
$order = [new \SqlSemantics\Platform\MySql\Statement\Query\OrderItem(new \SqlSemantics\Platform\MySql\Statement\Name\ColumnUse(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('b')))];
    $window = new \SqlSemantics\Platform\MySql\Statement\Call\Window\WindowSpec(null, [], $order, new \SqlSemantics\Platform\MySql\Statement\Call\Window\Frame(\SqlSemantics\Platform\MySql\Statement\Call\Window\FrameUnit::Rows, new \SqlSemantics\Platform\MySql\Statement\Call\Window\FrameBound(\SqlSemantics\Platform\MySql\Statement\Call\Window\FrameBoundKind::UnboundedPreceding)));
    [count($window->partition), count($window->order), $window->frame?->unit] // => [0, 1, \SqlSemantics\Platform\MySql\Statement\Call\Window\FrameUnit::Rows]

Properties§

public list<OrderItem> $partition
public list<OrderItem> $order
public Name|null $base = null
public Frame|null $frame = null

Methods§

public function __construct(
    public Name|null $base = null,
    list<OrderItem> $partition = [],
    list<OrderItem> $order = [],
    public Frame|null $frame = null,
)

Parameters

$baseName|nullThe window this one refines
$partitionlist<OrderItem>The partitioning expressions
$orderlist<OrderItem>The ordering items
$frameFrame|nullThe frame
Calls 2
public function deriveWindow(Derivation $derivation, Environment $environment): void

Derives the partitioning, the ordering and the frame offsets, and reports what the server does not support.

Parameters

$derivationDerivation
$environmentEnvironment
Test cases 2
Calls 7
public function render(Output $out): void

Writes the parenthesized specification.

Parameters

$outOutput
Test cases 1
Calls 5

Test cases 10§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 2
Other tests reaching this symbol 8

Relations§

Instantiated in 1
Type checks 1
Type declarations 1