{"action":"created","issue":{"url":"https://api.github.com/repos/alexrobbins/parquet-thrift-cascalog/issues/3","labels_url":"https://api.github.com/repos/alexrobbins/parquet-thrift-cascalog/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/alexrobbins/parquet-thrift-cascalog/issues/3/comments","events_url":"https://api.github.com/repos/alexrobbins/parquet-thrift-cascalog/issues/3/events","html_url":"https://github.com/alexrobbins/parquet-thrift-cascalog/pull/3","id":58950050,"number":3,"title":"Adds a \"pred\" macro for better filter definition","user":{"login":"sritchie","id":69635,"avatar_url":"https://avatars.githubusercontent.com/u/69635?v=3","gravatar_id":"","url":"https://api.github.com/users/sritchie","html_url":"https://github.com/sritchie","followers_url":"https://api.github.com/users/sritchie/followers","following_url":"https://api.github.com/users/sritchie/following{/other_user}","gists_url":"https://api.github.com/users/sritchie/gists{/gist_id}","starred_url":"https://api.github.com/users/sritchie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sritchie/subscriptions","organizations_url":"https://api.github.com/users/sritchie/orgs","repos_url":"https://api.github.com/users/sritchie/repos","events_url":"https://api.github.com/users/sritchie/events{/privacy}","received_events_url":"https://api.github.com/users/sritchie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-25T18:44:10Z","updated_at":"2015-02-25T19:28:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/alexrobbins/parquet-thrift-cascalog/pulls/3","html_url":"https://github.com/alexrobbins/parquet-thrift-cascalog/pull/3","diff_url":"https://github.com/alexrobbins/parquet-thrift-cascalog/pull/3.diff","patch_url":"https://github.com/alexrobbins/parquet-thrift-cascalog/pull/3.patch"},"body":"The code looked pretty good. I added two main items:\r\n\r\n### Column Protocol \r\n\r\nThe \"column\" protocol that allows you to define a column based on some comparison value and a column name. The implementation dispatches on the type of the comparison value. For example:\r\n\r\n```clojure\r\nparquet-thrift-cascalog.filter> (column (byte-array [1 2 3]) \"bytes\")\r\n#<BinaryColumn column(bytes)>\r\nparquet-thrift-cascalog.filter> (column 10 \"face\")\r\n#<LongColumn column(face)>\r\n```\r\n\r\nIt's also defined for a value that's already a column. That implementation just clones the column type but changes the column name:\r\n\r\n```clojure\r\nparquet-thrift-cascalog.filter> (column (column 10 \"face\") \"cake\")\r\n#<LongColumn column(cake)>\r\n```\r\n\r\nI DON'T have a String implementation defined, since Parquet doesn't give us a String column yet.\r\n\r\n### \"Pred\" macro\r\n\r\nNot a Cascalog predicate macro :) Just wanted to make things confusing.\r\n\r\nThe `pred` macro inside of the `filter` namespace allows you to use Clojure's `<=`, `<` etc comparators instead of `ltEq`, `lt` etc. The macro replaces the Clojure forms with the parquet forms, allowing you to declare filters like this:\r\n\r\n```clojure\r\nparquet-thrift-cascalog.filter> \r\n(pred\r\n (or (> \"cake\" 100.234)\r\n     (and (not (< \"face\" 10))\r\n          (>= \"face\" 13))))\r\n#<Or or(gt(cake, 100.234), and(not(lt(face, 10)), gteq(face, 13)))>\r\n```\r\n\r\nI added a test namespace for this too. I can add a few more tests if you're into this."},"comment":{"url":"https://api.github.com/repos/alexrobbins/parquet-thrift-cascalog/issues/comments/76036571","html_url":"https://github.com/alexrobbins/parquet-thrift-cascalog/pull/3#issuecomment-76036571","issue_url":"https://api.github.com/repos/alexrobbins/parquet-thrift-cascalog/issues/3","id":76036571,"user":{"login":"alexrobbins","id":83249,"avatar_url":"https://avatars.githubusercontent.com/u/83249?v=3","gravatar_id":"","url":"https://api.github.com/users/alexrobbins","html_url":"https://github.com/alexrobbins","followers_url":"https://api.github.com/users/alexrobbins/followers","following_url":"https://api.github.com/users/alexrobbins/following{/other_user}","gists_url":"https://api.github.com/users/alexrobbins/gists{/gist_id}","starred_url":"https://api.github.com/users/alexrobbins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexrobbins/subscriptions","organizations_url":"https://api.github.com/users/alexrobbins/orgs","repos_url":"https://api.github.com/users/alexrobbins/repos","events_url":"https://api.github.com/users/alexrobbins/events{/privacy}","received_events_url":"https://api.github.com/users/alexrobbins/received_events","type":"User","site_admin":false},"created_at":"2015-02-25T19:28:45Z","updated_at":"2015-02-25T19:28:45Z","body":"The changes look good to me. I'm going to copy your pred macro documentation into the readme.\r\n\r\nAlso, could we make the string stuff work transparently by having the macro automatically wrap string comparisons in the string->binary call and then use a binarycolumn? I think that is going to be a common use case for us."}}