Strip index term from result before passing to MR #618

Merged
merged 1 commit into from Jul 31, 2013

Projects

None yet

3 participants

@russelldb
Contributor

MR expects only a Key, 2i ranges now return {index_term, key}

@russelldb russelldb Strip index term from result before passing to MR
MR expects only a Key, 2i ranges now return {index_term, key}
96c87ef
@beerriot beerriot commented on the diff Jul 29, 2013
src/riak_kv_pipe_index.erl
@@ -104,13 +104,20 @@ keysend(_Bucket, [], _Partition, _FittingDetails) ->
ok;
keysend(Bucket, [Key | Keys], Partition, FittingDetails) ->
case riak_pipe_vnode_worker:send_output(
- {Bucket, Key}, Partition, FittingDetails) of
+ {Bucket, strip_index(Key)}, Partition, FittingDetails) of
@beerriot
beerriot Jul 29, 2013 Contributor

It would be much cooler to transform {Bucket, {IndexTerm, Key}} into {{Bucket, Key}, IndexTerm}, because then the map phase function would get the IndexTerm as its KeyData argument. Depending on representation, that might break Javascript phases, though.

@seancribbs seancribbs referenced this pull request in basho/riak-python-client Jul 30, 2013
Closed

Range query on a binary 2i raises an exception #270

@russelldb
Contributor

Add these tests, run without this patch you'll see failures basho/mapred_verify#4

@engelsanchez engelsanchez was assigned Jul 31, 2013
@beerriot beerriot referenced this pull request in basho/mapred_verify Jul 31, 2013
Open

Add tests for 2i inputs to map reduce #4

@beerriot
Contributor

This fix makes sense to me, and makes the new mapred_verify tests pass. +1 to merge

@beerriot beerriot was assigned Jul 31, 2013
@russelldb russelldb merged commit f216fe9 into 1.4 Jul 31, 2013

1 check failed

default The Travis CI build failed
Details
@seancribbs seancribbs deleted the gh617-2i-mr branch Apr 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment