The myria-docs/myriaql.markdown says that the running mean is a uda but it is in fact a stateful apply if I'm not wrong.
-- User-defined aggregate function
apply RunningMean(value) {
-- initialize the custom state, set cnt = 0 and summ = 0
[0 as cnt, 0 as summ];
-- for each record, add one one to the count (cnt) and add the record value to the sum (summ)
[cnt + 1 as cnt, summ + value as summ];
-- on each record, produce the running sum divided by the running count
s / c;
};
The myria-docs/myriaql.markdown says that the running mean is a uda but it is in fact a stateful apply if I'm not wrong.
This also needs to be corrected in raco.
CC @BrandonHaynes