skydb/sky — pull request #138 by matthelm (2013-09-12 02:31:34+00:00)
Title: Add average (mean) to available aggregations.

Hi Ben,

I'm interested in adding statistical functions to Sky. I've taken a swing at adding support for averages, and am interested in adding support for counts of unique values, something which is more CPU intensive because, like histograms, it's not commutative. I've added a simple test to show it's working, but would like some feedback before moving forward.

How do you feel about adding support for functions like avg, unique, std, etc.? The new query syntax allows for things like averages to be calculated within the query, but from what I can tell that requires two full sweeps? Also, do you like the current style of returning a blob of data in the serialization of larger map reduce objects like histogram? It seems weird to ask for the average and get back an object... `{"__average__":true,"avg":60,"count":6,"sum":360}`.

I'd love to hear your thoughts.

Matt Helm
Developer at Shopify