Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E0CE1DA4A for ; Tue, 6 Nov 2012 13:34:01 +0000 (UTC) Received: (qmail 92887 invoked by uid 500); 6 Nov 2012 13:34:00 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 92676 invoked by uid 500); 6 Nov 2012 13:33:59 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 92644 invoked by uid 99); 6 Nov 2012 13:33:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Nov 2012 13:33:58 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ponomarevvlad@gmail.com designates 209.85.223.180 as permitted sender) Received: from [209.85.223.180] (HELO mail-ie0-f180.google.com) (209.85.223.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Nov 2012 13:33:50 +0000 Received: by mail-ie0-f180.google.com with SMTP id e10so517573iej.11 for ; Tue, 06 Nov 2012 05:33:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=xvvi5YCICNEYZXcmNlQFQFy/9rThZjCHbhjIUF7yAno=; b=i814ONEO60hvgPWJwdfHOO7dwdbGpmua49Xz6wYS8jA1JL2cGqZG3rsl1CAJowCnal Wrsa5JTtoQUzt/7X92iIBxr2L1xBeTqkJdrLcxxkpI14oC5EMjzHaxlIyROO4c/V+efX 9bGgwtIfsK59ZN/IApckeAyKpY2U8FtAmlCsFc1eXnAOfSZ/ME7+VWCRj9uXvlj6p864 g8JPlRLfg1zgGIL9Vkfd66QVsgVWjDuPVGrEMgVMVcHGtEPsmBIeS4Q/kgcyex5c9O36 +zOOfobRoJ/5Kfa0j2xNW/mnRZOYibZ5/eGrK4Sl4Lh2zSHJIW8jxHrNTIMAT6foc5c/ SQTw== MIME-Version: 1.0 Received: by 10.43.7.132 with SMTP id oo4mr861092icb.6.1352208809211; Tue, 06 Nov 2012 05:33:29 -0800 (PST) Received: by 10.42.155.196 with HTTP; Tue, 6 Nov 2012 05:33:28 -0800 (PST) In-Reply-To: References: Date: Tue, 6 Nov 2012 17:33:28 +0400 Message-ID: Subject: Re: Any sort order guarantee for key (value) argument of CouchDB reduce function? From: Vladislav Ponomarev To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=bcaec50fe2dfbc38ff04cdd3a5bb X-Virus-Checked: Checked by ClamAV on apache.org --bcaec50fe2dfbc38ff04cdd3a5bb Content-Type: text/plain; charset=ISO-8859-1 Thank you Paul. This is odd to me, but I'll live with that :-) On Tue, Nov 6, 2012 at 5:05 PM, Paul J Davis wrote: > No, there aren't any guarantees. And rereduce can end up getting passed > some surprising (to me when I tried relying on ordering at least) sets of > keys. > > On Nov 6, 2012, at 1:55 PM, Vladislav Ponomarev > wrote: > > > Hello, > > > > Per CouchDB guide, the reduce function signature looks like this: > > > > function (key, values, rereduce) { > > return ...; // some calculations happen here > > } > > > > where the definition of first arguments is as follows: > > > >> > >> when rereduce is false, then: > >> > >> - key will be an array whose elements are arrays of the form [key,id], > >> where key is a key emitted by the map function and id is that of the > >> document from which the key was generated. > >> - values will be an array of the values emitted for the respective > >> elements in keys. > > My question is: when rereduce is false, are there any guarantees > regarding > > the order of key (or values) array elements? My gut feel (based on Reduce > > vs Rereduce chapter) is that keys, and respectively values, should be > > ordered, but I do not see any direct confirmation. > > > > Any ideas? Thank you! > --bcaec50fe2dfbc38ff04cdd3a5bb--