opteryx
opteryx copied to clipboard
✨ Add complex aggregators
trafficstars
The LIST aggregation type allows the values in each group to be collected and complex aggregations (i.e. ones that require more than one function call, or the output to be transformed) to be written.
Such as 'MODE' (i.e. most common value), 'RANGE' (i.e. MAX - MIN) and 'IQR'
These should be implemented as plan rewrites rather than in Python. For example,
SELECT mode(age) FROM people GROUP BY location;
-->
SELECT mode(list(age)) AS mode(age) FROM people GROUP BY location;