Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 40330 invoked from network); 10 Jun 2008 21:33:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jun 2008 21:33:31 -0000 Received: (qmail 9214 invoked by uid 500); 10 Jun 2008 21:33:34 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 8979 invoked by uid 500); 10 Jun 2008 21:33:33 -0000 Mailing-List: contact couchdb-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-user@incubator.apache.org Delivered-To: mailing list couchdb-user@incubator.apache.org Received: (qmail 8968 invoked by uid 99); 10 Jun 2008 21:33:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jun 2008 14:33:33 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ryszard.szopa@gmail.com designates 209.85.128.189 as permitted sender) Received: from [209.85.128.189] (HELO fk-out-0910.google.com) (209.85.128.189) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jun 2008 21:32:41 +0000 Received: by fk-out-0910.google.com with SMTP id 19so1802933fkr.12 for ; Tue, 10 Jun 2008 14:32:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=wV+CVU5IkKQFOBRSqQas58Ct6ElPdjnFiBY1AdiO8FQ=; b=c0nXhkRNrqJm/3KKwB46qQVwffrzrqWj5JLqDlpc8BuSsM70PYsfXIxGcw8IOV4Z8w 7xPRNfwThQPCL83NyUaH9zpbxm006rjhCfbtxdlHGN/7ZLgV0kvV9452tbdH/T6uXUsP Ysi2uX+nZqhIrf63G0uFxjtMfrBk71lAeBLFY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=DG7BnGyRizciaC33ZAUpP2Xg6bwAE6DReXbxSMPYTjoK07m7OwyFOwwbNInTv3FoI5 8guOGOLfGI3uWIZSxkJmfWSzUJSYFryVNlku7nRq/EnF1SyLN8pp+F54f+WYoVXB/uMC mwVWzPKrgpzV7tYpA7rJ4gakdgomdtMYJql7Y= Received: by 10.82.107.15 with SMTP id f15mr371089buc.86.1213133578003; Tue, 10 Jun 2008 14:32:58 -0700 (PDT) Received: by 10.82.116.6 with HTTP; Tue, 10 Jun 2008 14:32:57 -0700 (PDT) Message-ID: <19e19e410806101432k588a19d7y3db62e20e80c83c9@mail.gmail.com> Date: Tue, 10 Jun 2008 23:32:57 +0200 From: "Ryszard Szopa" To: couchdb-user@incubator.apache.org Subject: rereduce MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org Hi, I've updated CouchDB to revision 666301 just to realize that something has changed in the view-server protocol. Namely, CouchDB started sending 'rereduce' which completely confused my soon-to-be-ready lisp view-server. If I have figured out this right, instead of sending ["reduce", ...] and calling the reduce function on a list of (key value) pairs, it 1) Sends "reduce" and calls reduce on a fragment of the complete keys-and-vals list (in the cases I tested, from 4 to 9), stores the result 2) Sends "rereduce" and the list of partial results and expects them to be reduced. In couchjs the reduce function takes a new argument which determines whether it is in the reduce or rereduce phase. This incremental mapreduce looks like a great idea (changing one document doesn't make it necessary to recalculate the whole view), but the interface doesn't seem really optimal. It forces the user to write functions that have completely different behaviors and expect different kinds of things as arguments depending on one argument. This isn't really clean or elegant. Wouldn't it be a lot easier to make views have an additional attribute, rereduce? Cheers, -- Richard PS. The new view-server protocol is not documented on the wiki (it says nothing about reduce, not to mention rereduce). I could do that, but as I have only reversed engineered the protocol from the behavior of CouchDB (so I cannot say I really *know* it) I would like somebody to confirm I've got it right. -- http://szopa.tasak.gda.pl/