{"action":"created","comment":{"url":"https://api.github.com/repos/prestodb/presto/pulls/comments/77238441","id":77238441,"diff_hunk":"@@ -71,9 +91,166 @@ public boolean matches(long numberOfRows, Map<Integer, ColumnStatistics> statist\n             }\n             domains.put(columnReference.getColumn(), domain);\n         }\n+        // this is where we create a domain for this stripe, basically a map of what this stripe contains\n         TupleDomain<C> stripeDomain = TupleDomain.withColumnDomains(domains.build());\n \n-        return effectivePredicate.overlaps(stripeDomain);\n+        // compare effective predicate with the current stripe\n+        boolean overlap = effectivePredicate.overlaps(stripeDomain);\n+\n+        // use bloomfilters?\n+        if (!useOrcBloomfilters) {\n+            return overlap;\n+        }\n+\n+        // no overlap, no need to check the bloomfilters because we already know there's nothing here\n+        if (!overlap) {\n+            // No overlap, stop here\n+            return false;\n+        }\n+\n+        // we need to have filters in order to say we checked all\n+        if (columnReferences.isEmpty()) {\n+            // treat as failure: read\n+            return true;\n+        }\n+\n+        // fetch domains for effective predicate\n+        Optional<Map<C, Domain>> optionalEffectivePredicateDomains = effectivePredicate.getDomains();\n+        Optional<Map<C, Domain>> optionalStripeDomains = stripeDomain.getDomains();\n+\n+        // we need the effective predicate domains for bloom filter analysis\n+        if (!optionalEffectivePredicateDomains.isPresent() || !optionalStripeDomains.isPresent()) {\n+            // treat as failure: read\n+            return true;\n+        }\n+\n+        // effective predicate domains\n+        Map<C, Domain> effectivePredicateDomains = optionalEffectivePredicateDomains.get();\n+        if (effectivePredicateDomains.isEmpty()) {\n+            // no predicate, probably a where-less query, read\n+            return true;\n+        }\n+        Map<C, Domain> stripDomains = optionalStripeDomains.get();\n+\n+        // iterate column references\n+        for (ColumnReference<C> columnReference : columnReferences) {\n+            // is this part of a predicate?\n+            if (!effectivePredicateDomains.containsKey(columnReference.getColumn())) {\n+                continue;\n+            }\n+            // is this part of the stripe domain","path":"presto-orc/src/main/java/com/facebook/presto/orc/TupleDomainOrcPredicate.java","position":105,"original_position":104,"commit_id":"83cbb3376875f41e68ae224db269024adeccbf4e","original_commit_id":"a356541723cbe5ed9ff713e4af7e53aae315ff01","user":{"login":"maciejgrzybek","id":366501,"avatar_url":"https://avatars.githubusercontent.com/u/366501?v=3","gravatar_id":"","url":"https://api.github.com/users/maciejgrzybek","html_url":"https://github.com/maciejgrzybek","followers_url":"https://api.github.com/users/maciejgrzybek/followers","following_url":"https://api.github.com/users/maciejgrzybek/following{/other_user}","gists_url":"https://api.github.com/users/maciejgrzybek/gists{/gist_id}","starred_url":"https://api.github.com/users/maciejgrzybek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maciejgrzybek/subscriptions","organizations_url":"https://api.github.com/users/maciejgrzybek/orgs","repos_url":"https://api.github.com/users/maciejgrzybek/repos","events_url":"https://api.github.com/users/maciejgrzybek/events{/privacy}","received_events_url":"https://api.github.com/users/maciejgrzybek/received_events","type":"User","site_admin":false},"body":"ditto","created_at":"2016-09-01T19:30:55Z","updated_at":"2016-09-01T19:30:55Z","html_url":"https://github.com/prestodb/presto/pull/5998#discussion_r77238441","pull_request_url":"https://api.github.com/repos/prestodb/presto/pulls/5998","_links":{"self":{"href":"https://api.github.com/repos/prestodb/presto/pulls/comments/77238441"},"html":{"href":"https://github.com/prestodb/presto/pull/5998#discussion_r77238441"},"pull_request":{"href":"https://api.github.com/repos/prestodb/presto/pulls/5998"}}},"pull_request":{"url":"https://api.github.com/repos/prestodb/presto/pulls/5998","id":83477896,"html_url":"https://github.com/prestodb/presto/pull/5998","diff_url":"https://github.com/prestodb/presto/pull/5998.diff","patch_url":"https://github.com/prestodb/presto/pull/5998.patch","issue_url":"https://api.github.com/repos/prestodb/presto/issues/5998","number":5998,"state":"open","locked":false,"title":"Support skipping reads from ORC bloomfilters","user":{"login":"RobinUS2","id":1712500,"avatar_url":"https://avatars.githubusercontent.com/u/1712500?v=3","gravatar_id":"","url":"https://api.github.com/users/RobinUS2","html_url":"https://github.com/RobinUS2","followers_url":"https://api.github.com/users/RobinUS2/followers","following_url":"https://api.github.com/users/RobinUS2/following{/other_user}","gists_url":"https://api.github.com/users/RobinUS2/gists{/gist_id}","starred_url":"https://api.github.com/users/RobinUS2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobinUS2/subscriptions","organizations_url":"https://api.github.com/users/RobinUS2/orgs","repos_url":"https://api.github.com/users/RobinUS2/repos","events_url":"https://api.github.com/users/RobinUS2/events{/privacy}","received_events_url":"https://api.github.com/users/RobinUS2/received_events","type":"User","site_admin":false},"body":"This would fix #3071 ","created_at":"2016-08-31T15:43:03Z","updated_at":"2016-09-01T19:30:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"27026d3539d6ee84d1027212a4bfd6eda02ca74b","assignee":{"login":"dain","id":58298,"avatar_url":"https://avatars.githubusercontent.com/u/58298?v=3","gravatar_id":"","url":"https://api.github.com/users/dain","html_url":"https://github.com/dain","followers_url":"https://api.github.com/users/dain/followers","following_url":"https://api.github.com/users/dain/following{/other_user}","gists_url":"https://api.github.com/users/dain/gists{/gist_id}","starred_url":"https://api.github.com/users/dain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dain/subscriptions","organizations_url":"https://api.github.com/users/dain/orgs","repos_url":"https://api.github.com/users/dain/repos","events_url":"https://api.github.com/users/dain/events{/privacy}","received_events_url":"https://api.github.com/users/dain/received_events","type":"User","site_admin":false},"assignees":[{"login":"dain","id":58298,"avatar_url":"https://avatars.githubusercontent.com/u/58298?v=3","gravatar_id":"","url":"https://api.github.com/users/dain","html_url":"https://github.com/dain","followers_url":"https://api.github.com/users/dain/followers","following_url":"https://api.github.com/users/dain/following{/other_user}","gists_url":"https://api.github.com/users/dain/gists{/gist_id}","starred_url":"https://api.github.com/users/dain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dain/subscriptions","organizations_url":"https://api.github.com/users/dain/orgs","repos_url":"https://api.github.com/users/dain/repos","events_url":"https://api.github.com/users/dain/events{/privacy}","received_events_url":"https://api.github.com/users/dain/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/prestodb/presto/pulls/5998/commits","review_comments_url":"https://api.github.com/repos/prestodb/presto/pulls/5998/comments","review_comment_url":"https://api.github.com/repos/prestodb/presto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prestodb/presto/issues/5998/comments","statuses_url":"https://api.github.com/repos/prestodb/presto/statuses/83cbb3376875f41e68ae224db269024adeccbf4e","head":{"label":"RobinUS2:master","ref":"master","sha":"83cbb3376875f41e68ae224db269024adeccbf4e","user":{"login":"RobinUS2","id":1712500,"avatar_url":"https://avatars.githubusercontent.com/u/1712500?v=3","gravatar_id":"","url":"https://api.github.com/users/RobinUS2","html_url":"https://github.com/RobinUS2","followers_url":"https://api.github.com/users/RobinUS2/followers","following_url":"https://api.github.com/users/RobinUS2/following{/other_user}","gists_url":"https://api.github.com/users/RobinUS2/gists{/gist_id}","starred_url":"https://api.github.com/users/RobinUS2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobinUS2/subscriptions","organizations_url":"https://api.github.com/users/RobinUS2/orgs","repos_url":"https://api.github.com/users/RobinUS2/repos","events_url":"https://api.github.com/users/RobinUS2/events{/privacy}","received_events_url":"https://api.github.com/users/RobinUS2/received_events","type":"User","site_admin":false},"repo":{"id":40294338,"name":"presto","full_name":"RobinUS2/presto","owner":{"login":"RobinUS2","id":1712500,"avatar_url":"https://avatars.githubusercontent.com/u/1712500?v=3","gravatar_id":"","url":"https://api.github.com/users/RobinUS2","html_url":"https://github.com/RobinUS2","followers_url":"https://api.github.com/users/RobinUS2/followers","following_url":"https://api.github.com/users/RobinUS2/following{/other_user}","gists_url":"https://api.github.com/users/RobinUS2/gists{/gist_id}","starred_url":"https://api.github.com/users/RobinUS2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobinUS2/subscriptions","organizations_url":"https://api.github.com/users/RobinUS2/orgs","repos_url":"https://api.github.com/users/RobinUS2/repos","events_url":"https://api.github.com/users/RobinUS2/events{/privacy}","received_events_url":"https://api.github.com/users/RobinUS2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/RobinUS2/presto","description":"Distributed SQL query engine for running interactive analytic queries against big data sources.","fork":true,"url":"https://api.github.com/repos/RobinUS2/presto","forks_url":"https://api.github.com/repos/RobinUS2/presto/forks","keys_url":"https://api.github.com/repos/RobinUS2/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RobinUS2/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RobinUS2/presto/teams","hooks_url":"https://api.github.com/repos/RobinUS2/presto/hooks","issue_events_url":"https://api.github.com/repos/RobinUS2/presto/issues/events{/number}","events_url":"https://api.github.com/repos/RobinUS2/presto/events","assignees_url":"https://api.github.com/repos/RobinUS2/presto/assignees{/user}","branches_url":"https://api.github.com/repos/RobinUS2/presto/branches{/branch}","tags_url":"https://api.github.com/repos/RobinUS2/presto/tags","blobs_url":"https://api.github.com/repos/RobinUS2/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RobinUS2/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RobinUS2/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/RobinUS2/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RobinUS2/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/RobinUS2/presto/languages","stargazers_url":"https://api.github.com/repos/RobinUS2/presto/stargazers","contributors_url":"https://api.github.com/repos/RobinUS2/presto/contributors","subscribers_url":"https://api.github.com/repos/RobinUS2/presto/subscribers","subscription_url":"https://api.github.com/repos/RobinUS2/presto/subscription","commits_url":"https://api.github.com/repos/RobinUS2/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/RobinUS2/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/RobinUS2/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/RobinUS2/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/RobinUS2/presto/contents/{+path}","compare_url":"https://api.github.com/repos/RobinUS2/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RobinUS2/presto/merges","archive_url":"https://api.github.com/repos/RobinUS2/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RobinUS2/presto/downloads","issues_url":"https://api.github.com/repos/RobinUS2/presto/issues{/number}","pulls_url":"https://api.github.com/repos/RobinUS2/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/RobinUS2/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/RobinUS2/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RobinUS2/presto/labels{/name}","releases_url":"https://api.github.com/repos/RobinUS2/presto/releases{/id}","deployments_url":"https://api.github.com/repos/RobinUS2/presto/deployments","created_at":"2015-08-06T08:42:02Z","updated_at":"2016-03-18T00:24:51Z","pushed_at":"2016-09-01T12:29:53Z","git_url":"git://github.com/RobinUS2/presto.git","ssh_url":"git@github.com:RobinUS2/presto.git","clone_url":"https://github.com/RobinUS2/presto.git","svn_url":"https://github.com/RobinUS2/presto","homepage":"https://prestodb.io","size":62436,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"prestodb:master","ref":"master","sha":"b0ff6a9771963aabaf58062c74511ab38364cbd1","user":{"login":"prestodb","id":6882181,"avatar_url":"https://avatars.githubusercontent.com/u/6882181?v=3","gravatar_id":"","url":"https://api.github.com/users/prestodb","html_url":"https://github.com/prestodb","followers_url":"https://api.github.com/users/prestodb/followers","following_url":"https://api.github.com/users/prestodb/following{/other_user}","gists_url":"https://api.github.com/users/prestodb/gists{/gist_id}","starred_url":"https://api.github.com/users/prestodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestodb/subscriptions","organizations_url":"https://api.github.com/users/prestodb/orgs","repos_url":"https://api.github.com/users/prestodb/repos","events_url":"https://api.github.com/users/prestodb/events{/privacy}","received_events_url":"https://api.github.com/users/prestodb/received_events","type":"Organization","site_admin":false},"repo":{"id":5349565,"name":"presto","full_name":"prestodb/presto","owner":{"login":"prestodb","id":6882181,"avatar_url":"https://avatars.githubusercontent.com/u/6882181?v=3","gravatar_id":"","url":"https://api.github.com/users/prestodb","html_url":"https://github.com/prestodb","followers_url":"https://api.github.com/users/prestodb/followers","following_url":"https://api.github.com/users/prestodb/following{/other_user}","gists_url":"https://api.github.com/users/prestodb/gists{/gist_id}","starred_url":"https://api.github.com/users/prestodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestodb/subscriptions","organizations_url":"https://api.github.com/users/prestodb/orgs","repos_url":"https://api.github.com/users/prestodb/repos","events_url":"https://api.github.com/users/prestodb/events{/privacy}","received_events_url":"https://api.github.com/users/prestodb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prestodb/presto","description":"Distributed SQL query engine for big data","fork":false,"url":"https://api.github.com/repos/prestodb/presto","forks_url":"https://api.github.com/repos/prestodb/presto/forks","keys_url":"https://api.github.com/repos/prestodb/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prestodb/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prestodb/presto/teams","hooks_url":"https://api.github.com/repos/prestodb/presto/hooks","issue_events_url":"https://api.github.com/repos/prestodb/presto/issues/events{/number}","events_url":"https://api.github.com/repos/prestodb/presto/events","assignees_url":"https://api.github.com/repos/prestodb/presto/assignees{/user}","branches_url":"https://api.github.com/repos/prestodb/presto/branches{/branch}","tags_url":"https://api.github.com/repos/prestodb/presto/tags","blobs_url":"https://api.github.com/repos/prestodb/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prestodb/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prestodb/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/prestodb/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prestodb/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/prestodb/presto/languages","stargazers_url":"https://api.github.com/repos/prestodb/presto/stargazers","contributors_url":"https://api.github.com/repos/prestodb/presto/contributors","subscribers_url":"https://api.github.com/repos/prestodb/presto/subscribers","subscription_url":"https://api.github.com/repos/prestodb/presto/subscription","commits_url":"https://api.github.com/repos/prestodb/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/prestodb/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/prestodb/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/prestodb/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/prestodb/presto/contents/{+path}","compare_url":"https://api.github.com/repos/prestodb/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prestodb/presto/merges","archive_url":"https://api.github.com/repos/prestodb/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prestodb/presto/downloads","issues_url":"https://api.github.com/repos/prestodb/presto/issues{/number}","pulls_url":"https://api.github.com/repos/prestodb/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/prestodb/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/prestodb/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prestodb/presto/labels{/name}","releases_url":"https://api.github.com/repos/prestodb/presto/releases{/id}","deployments_url":"https://api.github.com/repos/prestodb/presto/deployments","created_at":"2012-08-09T01:03:37Z","updated_at":"2016-09-01T18:00:23Z","pushed_at":"2016-09-01T19:08:17Z","git_url":"git://github.com/prestodb/presto.git","ssh_url":"git@github.com:prestodb/presto.git","clone_url":"https://github.com/prestodb/presto.git","svn_url":"https://github.com/prestodb/presto","homepage":"https://prestodb.io","size":161341,"stargazers_count":5070,"watchers_count":5070,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1556,"mirror_url":null,"open_issues_count":629,"forks":1556,"open_issues":629,"watchers":5070,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prestodb/presto/pulls/5998"},"html":{"href":"https://github.com/prestodb/presto/pull/5998"},"issue":{"href":"https://api.github.com/repos/prestodb/presto/issues/5998"},"comments":{"href":"https://api.github.com/repos/prestodb/presto/issues/5998/comments"},"review_comments":{"href":"https://api.github.com/repos/prestodb/presto/pulls/5998/comments"},"review_comment":{"href":"https://api.github.com/repos/prestodb/presto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prestodb/presto/pulls/5998/commits"},"statuses":{"href":"https://api.github.com/repos/prestodb/presto/statuses/83cbb3376875f41e68ae224db269024adeccbf4e"}}}}
{"actor":{"display_login":"maciejgrzybek"}}