final class WindowRule
Restricted visibility: declared "@visibility SqlSemantics\Platform\PostgreSql\Lowering". Code outside that scope must not name this declaration.

Lowers OVER clauses and window specifications.

Rule: PG-WINDOW-LOWERING-001. Scope: over_clause, window_specification, opt_existing_window_name, opt_partition_clause, opt_frame_clause, frame_extent, frame_bound, opt_window_exclusion_clause. Constructors: WindowSpecification, WindowFrame, FrameBound. EXCLUDE NO OTHERS states the default and is noise (see InvocationNoise). The frames the grammar's action rejects (a start at UNBOUNDED FOLLOWING, an end at UNBOUNDED PRECEDING, a frame that ends before it starts) raise an AnalysisException with the server's message. Termination: the partition list is flattened iteratively. Source: https://www.postgresql.org/docs/17/sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe hub
public function over(Node $clause): WindowSpecification|Name|null

Lowers over_clause: a specification, a window name, or nothing.

Parameters

$clauseNode

Throws

AnalysisException When the frame is one the actions of `frame_extent` in `gram.y` reject
ImplementationGap When the production has no rule
Test cases 1
Called from 1
Calls 2
public function frame(Node $clause): ?WindowFrame

Lowers opt_frame_clause; no clause is null.

Parameters

$clauseNode

Returns

Throws

AnalysisException When the frame is one the server rejects while parsing
ImplementationGap When the production has no rule
Test cases 2
Called from 1
Calls 7

Private surface 4§

Implementation details, listed for orientation only.

private const BOUNDS = ['frame_bound: UNBOUNDED PRECEDING' => \SqlSemantics\Platform\PostgreSql\Statem…
private const EXCLUSIONS = ['opt_window_exclusion_clause:' => null, 'opt_window_exclusion_clause: EXCLUDE …
private const MODES = ['opt_frame_clause: RANGE frame_extent opt_window_exclusion_clause' => \SqlSema…
private Lowering $lowering

Test cases 6§

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

Dedicated tests 6

Relations§

Instantiated in 2
Method calls 2