You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error when encountering an unsupported aggregate function (#1020)
When handling aggregate functions in cross-shard queries, we can only
return a correct result for functions that we have explicit support for.
No matter what the aggregate function is doing, we need to know how to
combine the results from the separate shards.
Prior to this change, we would just silently do the wrong thing,
treating this as any other non-aggregate expression and just returning a
union of the rows from each query. We now explicitly check if an
aggregate function with that name exists and error if we don't recognize
it.
This is future proofed against new functions in later postgres versions,
as well as user defined aggregates (which we can likely never support).
This will produce a false positive if a function exists and is defined
as aggregate for some argument types but not others. But frankly anyone
doing that is asking for trouble.
This logic is objectively in the wrong place. What we are doing here is
validation, not parsing. However as I'm familiarizing myself with these
code paths and preparing a larger rearchitecture, I'm slowly hammering
things into a shape that's easier to move around. I do not intend on
leaving this logic here long term.
0 commit comments