{"action":"created","comment":{"url":"https://api.github.com/repos/zendesk/maxwell/pulls/comments/195296398","pull_request_review_id":128634502,"id":195296398,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTI5NjM5OA==","diff_hunk":"@@ -0,0 +1,71 @@\n+package com.zendesk.maxwell.filtering;\n+\n+\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+import java.util.Map;\n+import java.util.Set;\n+import java.util.regex.Pattern;\n+\n+public class FilterColumnPattern extends FilterPattern {\n+\tprivate static final Logger LOGGER = LoggerFactory.getLogger(FilterColumnPattern.class);\n+\tprivate final String columnName;\n+\tprivate final Pattern columnPattern;\n+\tprivate final boolean columnPatternIsNull;\n+\n+\tpublic FilterColumnPattern(\n+\t\tFilterPatternType type,\n+\t\tPattern dbPattern,\n+\t\tPattern tablePattern,\n+\t\tString columnName,\n+\t\tPattern columnPattern\n+\t) {\n+\t\tsuper(type, dbPattern, tablePattern);\n+\t\tthis.columnName = columnName;\n+\t\tthis.columnPattern = columnPattern;\n+\t\tthis.columnPatternIsNull = \"^null$\".equals(columnPattern.toString().toLowerCase());\n+\t}\n+\n+\t@Override\n+\tpublic void match(String database, String table, FilterResult match) { }","path":"src/main/java/com/zendesk/maxwell/filtering/FilterColumnPattern.java","position":31,"original_position":31,"commit_id":"a1f137093c0c721ed8d429e5eb5884e0f719a82a","original_commit_id":"a1f137093c0c721ed8d429e5eb5884e0f719a82a","user":{"login":"osheroff","id":260084,"node_id":"MDQ6VXNlcjI2MDA4NA==","avatar_url":"https://avatars1.githubusercontent.com/u/260084?v=4","gravatar_id":"","url":"https://api.github.com/users/osheroff","html_url":"https://github.com/osheroff","followers_url":"https://api.github.com/users/osheroff/followers","following_url":"https://api.github.com/users/osheroff/following{/other_user}","gists_url":"https://api.github.com/users/osheroff/gists{/gist_id}","starred_url":"https://api.github.com/users/osheroff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osheroff/subscriptions","organizations_url":"https://api.github.com/users/osheroff/orgs","repos_url":"https://api.github.com/users/osheroff/repos","events_url":"https://api.github.com/users/osheroff/events{/privacy}","received_events_url":"https://api.github.com/users/osheroff/received_events","type":"User","site_admin":false},"body":"I don't think a table pattern can strictly has-a column pattern, since rules could look like:\r\n\r\n```\r\n   exclude: db.*\r\n   include: db.included_table\r\n   exclude: db.included_table.col = reject_value_1\r\n   exclude: db.included_table.col = reject_value_2\r\n```\r\n\r\nunless I'm not quite getting your idea.\r\n\r\n","created_at":"2018-06-14T03:53:19Z","updated_at":"2018-06-14T03:53:19Z","html_url":"https://github.com/zendesk/maxwell/pull/1010#discussion_r195296398","pull_request_url":"https://api.github.com/repos/zendesk/maxwell/pulls/1010","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/zendesk/maxwell/pulls/comments/195296398"},"html":{"href":"https://github.com/zendesk/maxwell/pull/1010#discussion_r195296398"},"pull_request":{"href":"https://api.github.com/repos/zendesk/maxwell/pulls/1010"}},"in_reply_to_id":194927941},"pull_request":{"url":"https://api.github.com/repos/zendesk/maxwell/pulls/1010","id":194084009,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk0MDg0MDA5","html_url":"https://github.com/zendesk/maxwell/pull/1010","diff_url":"https://github.com/zendesk/maxwell/pull/1010.diff","patch_url":"https://github.com/zendesk/maxwell/pull/1010.patch","issue_url":"https://api.github.com/repos/zendesk/maxwell/issues/1010","number":1010,"state":"open","locked":false,"title":"Hoist column-level filters into `--filter` system","user":{"login":"osheroff","id":260084,"node_id":"MDQ6VXNlcjI2MDA4NA==","avatar_url":"https://avatars1.githubusercontent.com/u/260084?v=4","gravatar_id":"","url":"https://api.github.com/users/osheroff","html_url":"https://github.com/osheroff","followers_url":"https://api.github.com/users/osheroff/followers","following_url":"https://api.github.com/users/osheroff/following{/other_user}","gists_url":"https://api.github.com/users/osheroff/gists{/gist_id}","starred_url":"https://api.github.com/users/osheroff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osheroff/subscriptions","organizations_url":"https://api.github.com/users/osheroff/orgs","repos_url":"https://api.github.com/users/osheroff/repos","events_url":"https://api.github.com/users/osheroff/events{/privacy}","received_events_url":"https://api.github.com/users/osheroff/received_events","type":"User","site_admin":false},"body":"The only thing tricky here is that for efficiency's sake we do a two-pass filter:  first we check if the table for an event is included/excluded (based on database/table).  If we find that the table is excluded, we must make sure there's not a rule later that could bring a *row* out of the table in.\r\n\r\n@ericwush \r\n\r\n\r\n\r\n","created_at":"2018-06-11T19:47:38Z","updated_at":"2018-06-14T03:53:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1adeeaf6d09bc88e627cb1c1e4e227fa1a249c5f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/zendesk/maxwell/pulls/1010/commits","review_comments_url":"https://api.github.com/repos/zendesk/maxwell/pulls/1010/comments","review_comment_url":"https://api.github.com/repos/zendesk/maxwell/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zendesk/maxwell/issues/1010/comments","statuses_url":"https://api.github.com/repos/zendesk/maxwell/statuses/a1f137093c0c721ed8d429e5eb5884e0f719a82a","head":{"label":"zendesk:ben/column_filters","ref":"ben/column_filters","sha":"a1f137093c0c721ed8d429e5eb5884e0f719a82a","user":{"login":"zendesk","id":11525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNTI1","avatar_url":"https://avatars3.githubusercontent.com/u/11525?v=4","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"repo":{"id":30561160,"node_id":"MDEwOlJlcG9zaXRvcnkzMDU2MTE2MA==","name":"maxwell","full_name":"zendesk/maxwell","owner":{"login":"zendesk","id":11525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNTI1","avatar_url":"https://avatars3.githubusercontent.com/u/11525?v=4","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendesk/maxwell","description":"Maxwell's daemon, a mysql-to-json kafka producer","fork":false,"url":"https://api.github.com/repos/zendesk/maxwell","forks_url":"https://api.github.com/repos/zendesk/maxwell/forks","keys_url":"https://api.github.com/repos/zendesk/maxwell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendesk/maxwell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendesk/maxwell/teams","hooks_url":"https://api.github.com/repos/zendesk/maxwell/hooks","issue_events_url":"https://api.github.com/repos/zendesk/maxwell/issues/events{/number}","events_url":"https://api.github.com/repos/zendesk/maxwell/events","assignees_url":"https://api.github.com/repos/zendesk/maxwell/assignees{/user}","branches_url":"https://api.github.com/repos/zendesk/maxwell/branches{/branch}","tags_url":"https://api.github.com/repos/zendesk/maxwell/tags","blobs_url":"https://api.github.com/repos/zendesk/maxwell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendesk/maxwell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendesk/maxwell/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendesk/maxwell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendesk/maxwell/statuses/{sha}","languages_url":"https://api.github.com/repos/zendesk/maxwell/languages","stargazers_url":"https://api.github.com/repos/zendesk/maxwell/stargazers","contributors_url":"https://api.github.com/repos/zendesk/maxwell/contributors","subscribers_url":"https://api.github.com/repos/zendesk/maxwell/subscribers","subscription_url":"https://api.github.com/repos/zendesk/maxwell/subscription","commits_url":"https://api.github.com/repos/zendesk/maxwell/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendesk/maxwell/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendesk/maxwell/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendesk/maxwell/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendesk/maxwell/contents/{+path}","compare_url":"https://api.github.com/repos/zendesk/maxwell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendesk/maxwell/merges","archive_url":"https://api.github.com/repos/zendesk/maxwell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendesk/maxwell/downloads","issues_url":"https://api.github.com/repos/zendesk/maxwell/issues{/number}","pulls_url":"https://api.github.com/repos/zendesk/maxwell/pulls{/number}","milestones_url":"https://api.github.com/repos/zendesk/maxwell/milestones{/number}","notifications_url":"https://api.github.com/repos/zendesk/maxwell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendesk/maxwell/labels{/name}","releases_url":"https://api.github.com/repos/zendesk/maxwell/releases{/id}","deployments_url":"https://api.github.com/repos/zendesk/maxwell/deployments","created_at":"2015-02-09T22:06:13Z","updated_at":"2018-06-13T12:15:01Z","pushed_at":"2018-06-13T06:50:35Z","git_url":"git://github.com/zendesk/maxwell.git","ssh_url":"git@github.com:zendesk/maxwell.git","clone_url":"https://github.com/zendesk/maxwell.git","svn_url":"https://github.com/zendesk/maxwell","homepage":"http://maxwells-daemon.io/","size":10366,"stargazers_count":790,"watchers_count":790,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":299,"mirror_url":null,"archived":false,"open_issues_count":116,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":299,"open_issues":116,"watchers":790,"default_branch":"master"}},"base":{"label":"zendesk:ben/better_filtering","ref":"ben/better_filtering","sha":"2ac4668e89bda96aab3235c0f0c09467f3a2a9ff","user":{"login":"zendesk","id":11525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNTI1","avatar_url":"https://avatars3.githubusercontent.com/u/11525?v=4","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"repo":{"id":30561160,"node_id":"MDEwOlJlcG9zaXRvcnkzMDU2MTE2MA==","name":"maxwell","full_name":"zendesk/maxwell","owner":{"login":"zendesk","id":11525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNTI1","avatar_url":"https://avatars3.githubusercontent.com/u/11525?v=4","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendesk/maxwell","description":"Maxwell's daemon, a mysql-to-json kafka producer","fork":false,"url":"https://api.github.com/repos/zendesk/maxwell","forks_url":"https://api.github.com/repos/zendesk/maxwell/forks","keys_url":"https://api.github.com/repos/zendesk/maxwell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendesk/maxwell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendesk/maxwell/teams","hooks_url":"https://api.github.com/repos/zendesk/maxwell/hooks","issue_events_url":"https://api.github.com/repos/zendesk/maxwell/issues/events{/number}","events_url":"https://api.github.com/repos/zendesk/maxwell/events","assignees_url":"https://api.github.com/repos/zendesk/maxwell/assignees{/user}","branches_url":"https://api.github.com/repos/zendesk/maxwell/branches{/branch}","tags_url":"https://api.github.com/repos/zendesk/maxwell/tags","blobs_url":"https://api.github.com/repos/zendesk/maxwell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendesk/maxwell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendesk/maxwell/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendesk/maxwell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendesk/maxwell/statuses/{sha}","languages_url":"https://api.github.com/repos/zendesk/maxwell/languages","stargazers_url":"https://api.github.com/repos/zendesk/maxwell/stargazers","contributors_url":"https://api.github.com/repos/zendesk/maxwell/contributors","subscribers_url":"https://api.github.com/repos/zendesk/maxwell/subscribers","subscription_url":"https://api.github.com/repos/zendesk/maxwell/subscription","commits_url":"https://api.github.com/repos/zendesk/maxwell/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendesk/maxwell/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendesk/maxwell/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendesk/maxwell/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendesk/maxwell/contents/{+path}","compare_url":"https://api.github.com/repos/zendesk/maxwell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendesk/maxwell/merges","archive_url":"https://api.github.com/repos/zendesk/maxwell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendesk/maxwell/downloads","issues_url":"https://api.github.com/repos/zendesk/maxwell/issues{/number}","pulls_url":"https://api.github.com/repos/zendesk/maxwell/pulls{/number}","milestones_url":"https://api.github.com/repos/zendesk/maxwell/milestones{/number}","notifications_url":"https://api.github.com/repos/zendesk/maxwell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendesk/maxwell/labels{/name}","releases_url":"https://api.github.com/repos/zendesk/maxwell/releases{/id}","deployments_url":"https://api.github.com/repos/zendesk/maxwell/deployments","created_at":"2015-02-09T22:06:13Z","updated_at":"2018-06-13T12:15:01Z","pushed_at":"2018-06-13T06:50:35Z","git_url":"git://github.com/zendesk/maxwell.git","ssh_url":"git@github.com:zendesk/maxwell.git","clone_url":"https://github.com/zendesk/maxwell.git","svn_url":"https://github.com/zendesk/maxwell","homepage":"http://maxwells-daemon.io/","size":10366,"stargazers_count":790,"watchers_count":790,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":299,"mirror_url":null,"archived":false,"open_issues_count":116,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":299,"open_issues":116,"watchers":790,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zendesk/maxwell/pulls/1010"},"html":{"href":"https://github.com/zendesk/maxwell/pull/1010"},"issue":{"href":"https://api.github.com/repos/zendesk/maxwell/issues/1010"},"comments":{"href":"https://api.github.com/repos/zendesk/maxwell/issues/1010/comments"},"review_comments":{"href":"https://api.github.com/repos/zendesk/maxwell/pulls/1010/comments"},"review_comment":{"href":"https://api.github.com/repos/zendesk/maxwell/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zendesk/maxwell/pulls/1010/commits"},"statuses":{"href":"https://api.github.com/repos/zendesk/maxwell/statuses/a1f137093c0c721ed8d429e5eb5884e0f719a82a"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"osheroff"}}