You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Ryszard Szopa <ry...@gmail.com> on 2008/06/23 17:15:34 UTC

separate rereduce component in view proposal

At present, the same function is used in both the reduce and rereduce
phase.The view-server is expected to inform the reduce function that
it is going to be a rereduce (in JS this is done by passing an
additional, third argument, in Common Lisp by setting a special
variable). Because of this all reduce functions (except the most
simple ones) have to start with testing in which phase they are and
depending on the result of this test behave completely differently (in
reduce they get keys and values; in rereduce they get just a list of
values).

My proposition is to add an optional component to view objects,
"rereduce". This should be a function that taking a list (array) of
intermediate values and returning the result of rereducing it. If it
was present in the view, couchdb would pass it to the view-server in
the rereduce phase. Otherwise, "reduce" would be passed (as it is done
now).

    -- Richard
-- 
http://szopa.tasak.gda.pl/