Sum implements AggregatingFunction, FrameAccumulating, WindowFunction uses ResolvesFromChildren
FinalYes
Interfaces
- AggregatingFunction
- FrameAccumulating
- Opts a WindowFunction into incremental frame evaluation. Carrying it asserts the result depends only on the frame contents - never on the current row or its index - which is what lets WindowProcessor reuse a value across rows that share frame bounds.
- WindowFunction
Methods
- __construct() : mixed
- accumulator() : FrameAccumulator
- aggregate() : void
- apply() : mixed
- children() : array<int, FunctionTree>
- Every operand of this node that is an expression, in constructor order.
- outputName() : string
- Decided in the constructor, never mutated.
- over() : static
- Returns a copy bound to $window. Never mutates $this.
- references() : null|array<int, Reference>
- resolved() : bool
- returns() : Type<string|int, mixed>
- float, not the argument type - RunningSum::add() promotes to float on int overflow, so integer would be a declaration the accumulator can violate on ordinary data
- toString() : string
- value() : null|array<string|int, mixed>|bool|float|int|object|string
- window() : Window
- withChildren() : static
- A copy of this node with $children in place of children(): same count, same order, same per-element narrowing. Never mutates $this.
Methods
__construct()
public
__construct(Reference $ref[, ScalarFunction|bool $exact = false ][, Window|null $window = null ]) : mixed
Parameters
- $ref : Reference
- $exact : ScalarFunction|bool = false
- $window : Window|null = null
accumulator()
public
accumulator(FlowContext $context) : FrameAccumulator
Parameters
- $context : FlowContext
Return values
FrameAccumulatoraggregate()
public
aggregate(Row $row, FlowContext $context) : void
Parameters
- $row : Row
- $context : FlowContext
apply()
public
apply(WindowContext $window) : mixed
Parameters
- $window : WindowContext
children()
Every operand of this node that is an expression, in constructor order.
public
children() : array<int, FunctionTree>
Return values
array<int, FunctionTree>outputName()
Decided in the constructor, never mutated.
public
outputName() : string
Return values
stringover()
Returns a copy bound to $window. Never mutates $this.
public
over(Window $window) : static
Parameters
- $window : Window
Return values
staticreferences()
public
references() : null|array<int, Reference>
Return values
null|array<int, Reference> —null when $exact is a ScalarFunction - its entries cannot be statically enumerated, so spill column pruning must be disabled
resolved()
public
resolved() : bool
Return values
boolreturns()
float, not the argument type - RunningSum::add() promotes to float on int overflow, so integer would be a declaration the accumulator can violate on ordinary data
public
returns() : Type<string|int, mixed>
Return values
Type<string|int, mixed>toString()
public
toString() : string
Return values
stringvalue()
public
value() : null|array<string|int, mixed>|bool|float|int|object|string
Return values
null|array<string|int, mixed>|bool|float|int|object|stringwindow()
public
window() : Window
Return values
WindowwithChildren()
A copy of this node with $children in place of children(): same count, same order, same per-element narrowing. Never mutates $this.
public
withChildren(array<int, FunctionTree> $children) : static
Parameters
- $children : array<int, FunctionTree>