tomjaguarpaw / haskell-opaleye

Other
605 stars 115 forks source link

Support for Ordered-Set Aggregate Functions #521

Open remeike opened 3 years ago

remeike commented 3 years ago

While I'm asking about aggregate functions, I was wondering if there could be support for ordered-set aggregate functions, so that it would be possible to implement functions such as percentile_cont and percentile_disc. As far as I can tell such functions just require an ORDER BY clause but the syntax is a bit different from other aggregate expressions:

aggregate_name (expression) WITHIN GROUP (order_by_clause)

tomjaguarpaw commented 3 years ago

I'd like to support this but I would have to spend some time just understanding the semantics of these operations and whether they are compatible with Opaleye's semantics. I'm confident they are, but I need to be sure. Regrettably I don't think I'll have time to work on this in the near future but happy to advise anyone who wants to work on it.