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

Lowers function calls written with the function's name, and their arguments and aggregate clauses.

Rule: PG-CALL-LOWERING-001. Scope: func_expr, func_expr_windowless, func_application, func_arg_list, func_arg_expr, func_arg_list_opt, within_group_clause, filter_clause. Constructor: FunctionCall, PositionalArgument, NamedArgument; the SQL-syntax functions and the JSON aggregates go to their rules. ALL before the arguments builds the same node as no quantifier (noise, see InvocationNoise). The grammar rejects WITHIN GROUP together with an ordering inside the parentheses, DISTINCT or VARIADIC: such SQL is outside the language and raises an AnalysisException with the server's message. Termination: argument lists are flattened iteratively. Source: https://www.postgresql.org/docs/17/sql-expressions.html#SQL-EXPRESSIONS-FUNCTION-CALLS, https://www.postgresql.org/docs/17/sql-expressions.html#SYNTAX-AGGREGATES. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe hub
public function call(Node $call): Scalar
public function application(
    Node $application,
    list<SortItem> $withinGroup = [],
    ?Scalar $filter = null,
    Node|null $over = null,
): FunctionCall

Lowers func_application with the clauses that may follow it.

Parameters

$applicationNode
$withinGrouplist<SortItem>The ordering written after WITHIN GROUP
$filter?Scalar
$overNode|nullThe `over_clause` that follows

Throws

AnalysisException When WITHIN GROUP is combined with an ordering, DISTINCT or VARIADIC, which the action of `func_expr: func_application within_group_clause filter_clause over_clause` in `gram.y` rejects
ImplementationGap When the production has no rule
Test cases 1
Called from 3
Calls 6
public function windowed(Form $form): FunctionCall

Lowers func_expr: func_application within_group_clause filter_clause over_clause.

Parameters

$formForm

Throws

AnalysisException When WITHIN GROUP is combined with an ordering, DISTINCT or VARIADIC
Called from 1
Calls 3
public function withinGroup(Node $clause): list<SortItem>

Lowers within_group_clause; no clause is an empty ordering.

Parameters

$clauseNode

Returns

list<SortItem>

Throws

ImplementationGap When the production has no rule
Test cases 1
Called from 1
Calls 2
public function filter(Node $clause): ?Scalar

Lowers filter_clause; no clause is null.

Parameters

$clauseNode

Returns

Throws

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

Private surface 1§

Implementation details, listed for orientation only.

private Lowering $lowering

Test cases 10§

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

Dedicated tests 10

Relations§

Instantiated in 3
Method calls 3