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

Lowers the window functions and the window written after OVER.

Rule: MYSQL-CALL-WINDOW-001. Scope: window_func_call, opt_lead_lag_info, opt_ll_default, stable_integer, param_or_var, opt_null_treatment, opt_from_first_last, opt_windowing_clause, windowing_clause, window_name_or_spec, window_name. The count of NTILE and the offset of LEAD and LAG are an integer, a parameter marker, a routine variable or a user variable. RESPECT NULLS, IGNORE NULLS, FROM FIRST and FROM LAST are kept as written. Constructs: WindowFunction, RoutineVariable. Terminates: every child is a strict subtree. Source: https://dev.mysql.com/doc/refman/8.4/en/window-function-descriptions.html, https://dev.mysql.com/doc/refman/8.4/en/window-functions-usage.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering, private FrameRule $frames)

Parameters

$loweringLoweringThe lowering this rule belongs to
$framesFrameRuleThe window specification rules
public function offset(Node $options): list<Scalar>

Lowers the offset and default of LEAD and LAG: a node of opt_lead_lag_info.

Parameters

$optionsNode

Returns

list<Scalar>

Throws

ImplementationGap When a production has no rule
Test cases 1
Called from 1
Calls 3
public function nulls(Node $treatment): ?NullTreatment

Lowers the NULL treatment: a node of opt_null_treatment.

Parameters

$treatmentNode

Throws

ImplementationGap When the production has no rule
Test cases 1
Called from 1
Calls 4
public function edge(Node $edge): ?CountingEdge

Lowers the edge of NTH_VALUE: a node of opt_from_first_last.

Parameters

$edgeNode

Returns

Throws

ImplementationGap When the production has no rule
Test cases 1
Called from 1
Calls 4

Private surface 5§

Implementation details, listed for orientation only.

private const FUNCTIONS = ['window_func_call: ROW_NUMBER_SYM ( ) windowing_clause' => [\SqlSemantics\Plat…
private const NULLS = ['opt_null_treatment:' => null, 'opt_null_treatment: RESPECT_SYM NULLS_SYM' => …
private const EDGES = ['opt_from_first_last:' => null, 'opt_from_first_last: FROM FIRST_SYM' => \SqlS…
private Lowering $lowering
private FrameRule $frames

Test cases 17§

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

Dedicated tests 9
Other tests reaching this symbol 8

Relations§

Instantiated in 1
Method calls 5
Type declarations 2