pub fn reject_unsupported_sync_aggregate(ast: &Ast) -> Result<(), BuildError>Expand description
Reject a relationship sum/avg aggregate anywhere in ast’s related tree — the
precomputed-sync path (synthetic aggregate base tables, AGGREGATE-SYNC-DESIGN.md §3)
is count-only: it ships the reduce’s (group…, count) row as a base table and has
no wire encoding for a sum/avg value or its int-vs-real typing. A relationship
sum/avg still works for a direct engine read (the generic scalar projection);
it is only unsupported for sync materialization, so registration surfaces it as a
[BuildError] rather than silently minting a count-shaped synthetic table. Call this at
each sync-registration entry (the replica’s register_shared_query, the room’s
materialize) before any of table_tree / agg_table_schemas / NormalizeFold
walk the tree — that ordering is what makes the Sum/Avg arm of hash_agg_subquery
unreachable.