4 ms·
Am I crazy or was there not a single reduce query in the post? I've been working on map reduce queries for a little while now, aggregating statistics over feeds
by conesus 16y ago
Am I crazy or was there not a single reduce query in the post? I've been working on map reduce queries for a little while now, aggregating statistics over feeds and stories posted, normalizing over item frequencies, and generally doing simple stuff.
I was very excited to see the second half of MapReduce. The reduce queries are always harder to write. If map is addition, reduce is division. I was hoping for examples on different reduce queries that are more advanced than the standard count tags in a list of lists. But no reduce period, so am I missing something?
- mlmilleratmit 16y agoPlenty of reduce queries, you just didn't need to write the code ;) Good point, though, good material for the next round. I'm open to suggestions if you have an interesting data set or question.
- moultano 16y agoHere's a great example of something that is most natural in mapreduce: http://www.danvk.org/wp/2007-04-06/nebulabrot/ http://www.danvk.org/wp/2007-04-06/nebulabrot/
- banjiewen 16y agoThere are reduce views there - both examples 2 and 3 use the built-in "_sum" reduce, which is equivalent to something like: function(key, values, rereduce) { return sum(values); } With regard to more advanced views: you'd be surprised how far you can get with the built-ins (_sum, _count, _stats); I've built a non-trivial data backend (on Cloudant, natch,) using pretty much entirely _sum reduces. Abusing the reduce with complex calculations doesn't seem to be worth it from either a disk space or query performance standpoint.