fn matching_payload_shape(
agg: &Aggregate,
function: PayloadFunction,
) -> Option<PayloadMatch<'_>>Expand description
Matches the narrow supported AVG(payload * payload) or
SUM(payload * payload) shape and returns the join plus everything the
rewrite needs from it.
Required shape: an inner ON equi-join whose group and payload columns map directly
to the respective join sides,
grouped by the left host and the right area, aggregated by a single
AVG — or, for PayloadFunction::Sum, SUM — of the product of those two
columns, with no DISTINCT, FILTER, ORDER BY, null treatment or extra
argument. The product operands may be given in either order and may reach the
aggregate through a projection that repeats them.