Substiute of CUME_DIST() over_clause

Hi
I am looking for equivalent of CUME_DIST() over_clause

There’s no easy way to do this exactly that I know of in SQL in SingleStoreDB.

Consider instead running a query with ORDER BY on the ordering column(s) you want, and shipping the output to an application and do the CUME_DIST in the app.

Alternatively, build it using a Wasm UDAF with “handle” state:

You’d have to accumulate the whole rowset, sort it, do the cume_dist, and return the result as, say, a json array of numbers. Might be worth it if you really want the output in SQL.

We’ll open a feature request for this.