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 694FEFE12 for ; Thu, 4 Apr 2013 10:47:49 +0000 (UTC) Received: (qmail 79096 invoked by uid 500); 4 Apr 2013 10:47:47 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 78412 invoked by uid 500); 4 Apr 2013 10:47:46 -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 78384 invoked by uid 99); 4 Apr 2013 10:47:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Apr 2013 10:47:46 +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 (athena.apache.org: domain of space.ship.traveller@gmail.com designates 209.85.217.176 as permitted sender) Received: from [209.85.217.176] (HELO mail-lb0-f176.google.com) (209.85.217.176) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Apr 2013 10:47:41 +0000 Received: by mail-lb0-f176.google.com with SMTP id y8so2556160lbh.35 for ; Thu, 04 Apr 2013 03:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=VTeYHQ0ey5PdImpwDTCTuF9il9yBAM5oxRyUWk7TOws=; b=OkWAux69N87+LgIdcoNVsywooOGqDw0tgjcoDj7+ZT0O4dMjosDBLirdAxzc1sdRZT 9YXRu4kBftGi44Lqme6MJiaUoBjxYy3kjCNfTkakZLwtG9bhv9zgR30JHZuLLcUoRzIH XVQMZebXsmujroE4uNOswiZBbKyJAWa97bOhnSH1ONjgk5vgGlO3AaHGLsxcx4+7IgNy 2Tp6HcQsDGWsH32hqJpbyV8qcnh1ZnJ69ExTdHoGZkvslPZjPcHXRI0ffcQKne8EYZ/c ucj3XL1fArgKjpm0J6IuYq2TpNTcZRA0a+p4Wz/j0g9QvSpfZCGjJ84o8xcydWkWg/4f y93A== MIME-Version: 1.0 X-Received: by 10.112.144.6 with SMTP id si6mr3118839lbb.85.1365072439709; Thu, 04 Apr 2013 03:47:19 -0700 (PDT) Received: by 10.112.146.7 with HTTP; Thu, 4 Apr 2013 03:47:19 -0700 (PDT) In-Reply-To: References: Date: Thu, 4 Apr 2013 23:47:19 +1300 Message-ID: Subject: Re: add_lib in reducers? From: Samuel Williams To: user@couchdb.apache.org, dev@couchdb.apache.org Content-Type: multipart/alternative; boundary=047d7b34363adc97a704d986b1e2 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b34363adc97a704d986b1e2 Content-Type: text/plain; charset=ISO-8859-1 Okay, despite what I said, I got the itch. Here is my proposal for a new query server interface: https://docs.google.com/document/d/1JtfvCpNB9pRQyLhS5KkkEdJ-ghSCv89xnw5HDMTCsp8/edit?usp=sharing Please feel free to critique. On 4 April 2013 21:01, Samuel Williams wrote: > I see. There are many cases when reduce code may need library > functionality. One very important case is when you are dealing with custom > data types, e.g. decimal numbers, that require specific functions to add, > subtract, etc. > > The entire query server interface seems like a huge mess. It would be nice > if there was some way to improve it e.g. CouchDB 2.0 could have an entirely > new query server interface. > > I'd be happy to write a proposal but I wouldn't have time to dedicate to > it unless I knew it was going to be seriously considered. > > > On 4 April 2013 19:21, Alexander Shorin wrote: > >> Hi Samuel! >> >> There is issue with patch about it: >> https://issues.apache.org/jira/browse/COUCHDB-1202 >> >> And there is the explanation why so: >> >> > One other issue: currently I haven't yet implemented commonjs for >> > reduce functions. The reason I have not is that reduce functions are >> > not batched, so library code would have to be sent and eval'd every >> > single time the reduce function is run. On top of this, 99% of the >> > time the reduce function won't make use of the library code, so it >> > will just be dead weight. (I have a hard time thinking of when a >> > reduce function will need to require library code). >> >> >> http://mail-archives.apache.org/mod_mbox/couchdb-dev/201009.mbox/%3CAANLkTi=hFvB8__sSfqtfZykv3E-H0oDcduqaZMtVE9Rc@mail.gmail.com%3E >> >> Hope they make things clear (: >> >> -- >> ,,,^..^,,, >> >> >> On Thu, Apr 4, 2013 at 5:44 AM, Samuel Williams >> wrote: >> > Hi, >> > >> > I've implemented a Ruby query server. >> > >> > I wanted to have libraries available to reduce functions. >> > >> > Is it okay to have add_lib add libraries to both mapper context and >> reduce >> > context? >> > >> > The method of loading libraries seems a bit cumbersome in the current >> > implementation, reducers are treated quite differently from mappers. Is >> > there any plan to improve this going forward? >> > >> > Kind regards, >> > Samuel >> > > --047d7b34363adc97a704d986b1e2--