incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rosenfield.alb...@gmail.com
Subject graph traversal in map+reduce
Date Tue, 19 Jun 2012 01:12:13 GMT
Hi experts

I recently did my first map+reduce function.
I used CouchDb for this (obviously ;-)).

It is a graph traversal algorithm.

map() picks up raw objects from the database,
(re-)reduce creates a number of graphs out of these.

What I found when doing this, is that you cannot filter for any
particular graph before you've run the entire reduce phase to it's
completion.

The information about which object belongs to which graph simply isn't
available until then.

This means that the usual mechanism for doing filtering, which is to
omit certain rows from being emit()'ed in map, does not work for such
algorithms.

Does anyone have any experience with this?

Is there a good way to access the filter key normally given to map()
from within reduce()?

Is there a good way to figure out when the function is in the final
re-reduce, so that objects not in any graph, in the wrong graph, etc.
can be filtered out?

Mime
View raw message