Clarification on key filters

Jeremiah Peschka jeremiah.peschka at gmail.com
Wed May 25 21:34:46 EDT 2011


An MR job has 0 or more key filters. Adding a few transforms generates a
lovely list of lists:

{
  "inputs":{
     "bucket":"invoices"
     "key_filters":[["tokenize", "-", 1],
                    ["to_lower"],
                    ["matches", "solutions"]]
   },
   // ...}

That makes sense: we've got a list of key filters. And a key filter is, in
effect, a list of arguments.

The complex predicates are throwing me off. Looking at the spec from Ripple
in filter_builder_spec.rb [1] and it's showing that

subject.OR do
  starts_with "foo"
  ends_with "bar"
end

becomes

[[:or, [[:starts_with, "foo"],[:ends_with, "bar"]]]]

Which is not at all the same as what the wiki says an OR should look like:

["or", [["eq", "google"]], [["less_than", "g"]]]

Apart from the obvious difference in syntax, have I been drinking mouthwash
or did the wiki suddenly switch from showing a complete key filter condition
to showing an individual key filter command for AND, OR, and NOT?

Jeremiah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20110525/72aeb0d0/attachment.html>


More information about the riak-users mailing list