MergedAggregate implements AggregatingFunction
Reads the column $aggregate->outputName() as partials and merges them; its output is $aggregate's value(), so wave 2 of a shuffle and the parent's finisher reuse the group-by processor unchanged.
Interfaces
Methods
- __construct() : mixed
- aggregate() : void
- children() : array<int, FunctionTree>
- The inner aggregator is resolved already; the resolver must not touch it.
- describe() : null|Description
- deterministic() : bool
- True when this node and every node in children() produce the same value for the same input row.
- fromDescription() : static
- merge() : void
- Folds a partial() of another instance into this one; that instance aggregated rows that come after this one's (merge()'s contract).
- outputName() : string
- Decided in the constructor, never mutated.
- partial() : array<string, mixed>
- This aggregator's state as plain values of partialType(); an aggregator that saw no row returns its initial state.
- partialType() : StructureType<string|int, array<string, mixed>>
- The structure partial() returns; valid once the aggregator is resolved (Aggregators::resolved()).
- references() : null|array<int, Reference>
- resolved() : bool
- True when this node and every node in children() can answer returns().
- returns() : Type<string|int, mixed>
- An OptionalType return declares the produced column nullable; there is no nullable() peer.
- value() : null|array<string|int, mixed>|bool|float|int|object|string
- withChildren() : static
- A fresh inner aggregator, as Aggregators::fresh() needs.
Methods
__construct()
public
__construct(AggregatingFunction $aggregate) : mixed
Parameters
- $aggregate : AggregatingFunction
-
resolved against the plan's input schema
aggregate()
public
aggregate(Rows $rows, array<string|int, mixed> $indices, Backend $backend) : void
Parameters
children()
The inner aggregator is resolved already; the resolver must not touch it.
public
children() : array<int, FunctionTree>
Return values
array<int, FunctionTree>describe()
public
describe() : null|Description
Return values
null|Description —null when this instance cannot cross a process boundary (a live client, a custom collaborator)
deterministic()
True when this node and every node in children() produce the same value for the same input row.
public
deterministic() : bool
False for a generator (now(), uuid, a random string): a caller that evaluates the tree once per FILE or per partition instead of once per row must refuse a non-deterministic one.
Return values
boolfromDescription()
public
static fromDescription(array<string|int, mixed> $data, Rebuild $rebuild) : static
Parameters
- $data : array<string|int, mixed>
- $rebuild : Rebuild
Return values
staticmerge()
Folds a partial() of another instance into this one; that instance aggregated rows that come after this one's (merge()'s contract).
public
merge(array<string|int, mixed> $partial, Backend $backend) : void
Parameters
- $partial : array<string|int, mixed>
- $backend : Backend
outputName()
Decided in the constructor, never mutated.
public
outputName() : string
Return values
stringpartial()
This aggregator's state as plain values of partialType(); an aggregator that saw no row returns its initial state.
public
partial() : array<string, mixed>
Return values
array<string, mixed>partialType()
The structure partial() returns; valid once the aggregator is resolved (Aggregators::resolved()).
public
partialType() : StructureType<string|int, array<string, mixed>>
Return values
StructureType<string|int, array<string, mixed>>references()
public
references() : null|array<int, Reference>
Return values
null|array<int, Reference> —references this aggregator reads, or null when they cannot be statically enumerated (disables spill column pruning)
resolved()
True when this node and every node in children() can answer returns().
public
resolved() : bool
Return values
boolreturns()
An OptionalType return declares the produced column nullable; there is no nullable() peer.
public
returns() : Type<string|int, mixed>
Return values
Type<string|int, mixed>value()
public
value() : null|array<string|int, mixed>|bool|float|int|object|string
Return values
null|array<string|int, mixed>|bool|float|int|object|stringwithChildren()
A fresh inner aggregator, as Aggregators::fresh() needs.
public
withChildren(array<string|int, mixed> $children) : static
Parameters
- $children : array<string|int, mixed>