Let's say, I have events and users. I want to group events by properties of
users. In SQL it looks like this:

SELECT u.gender,
       u.age,
       u.nfr,
       u.nafr,
       e.event_id,
       COUNT(e.id) ecount,
       SUM(e.event_value) esum
FROM sn_users u
JOIN daily_events e on e.sn_user_id = u.sn_id
GROUP BY u.gender, u.age, u.nfr, u.nafr, e.event_id;

I understand that link walking with mapreduce may help me with this.
However, all examples of link walking I've seen so far substitute the
original document. That is, if I were to link-walk event document I'd get a
bunch of users, without events.

How it ideally should be (in my imagination).

- Links are walked on event documents and corresponding users are embedded
into events.
- Map function now acts on a "joined" document and can emit appropriate
values.
- Reduce - nothing fancy here.

Is it possible at all?

-- 
Best regards,
Sergei Tulentsev
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to