couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samuel Williams <space.ship.travel...@gmail.com>
Subject Re: add_lib in reducers?
Date Thu, 04 Apr 2013 10:47:19 GMT
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 <space.ship.traveller@gmail.com>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 <kxepal@gmail.com> 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
>> <space.ship.traveller@gmail.com> 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
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message