Created
April 13, 2011 22:52
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mjr_> If you have an object that contains a JSON array of bucket, key pairs, | |
can you use that as a starting point in mapred? | |
17:58 <aphyr> yes. | |
17:59 <aphyr> mjr_: you start the mapreduce phase with that object as your sole input | |
17:59 <aphyr> A map phase returns the list of bucket, key pairs | |
17:59 <aphyr> then the subsequent map phase will operate on those | |
18:00 <mjr_> is there some builtin function or something that fetches the contents? | |
18:00 <aphyr> It'd be implementation-dependent. | |
18:01 <aphyr> Here's a trivial one: function(v) { return JSON.parse(v.data); } | |
18:01 <aphyr> (if you structure your data as JSON and store a list of [bucket, key] pairs | |
18:01 <mjr_> So v = ["users", "mjr"]; | |
18:02 <mjr_> Just returning that tuple returns two strings. How do I get | |
the contents of /riak/users/mjr in the map function? | |
18:02 <aphyr> v = "[[\"users\", \"mjr\"]]" | |
18:02 <aphyr> The input to a map phase is a list of key, value, keydata lists. | |
18:03 <aphyr> Er, sorry, [bucket, key, keydata] | |
18:03 <mjr_> ohh | |
18:03 <aphyr> So the next map phase would be called with the actual | |
data of /riak/users/mjr | |
18:03 <mjr_> oh, cool. That's perfect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment