{"action":"created","comment":{"url":"https://api.github.com/repos/apache/parquet-mr/pulls/comments/138801251","pull_request_review_id":62642343,"id":138801251,"diff_hunk":"@@ -0,0 +1,485 @@\n+/*\n+ * Licensed to the Apache Software Foundation (ASF) under one\n+ * or more contributor license agreements.  See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership.  The ASF licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License.  You may obtain a copy of the License at\n+ *\n+ *   http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ * KIND, either express or implied.  See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+package org.apache.parquet.column.values.bloom;\n+\n+import java.io.IOException;\n+import java.nio.ByteBuffer;\n+import java.nio.ByteOrder;\n+import java.util.ArrayList;\n+import java.util.Arrays;\n+import java.util.HashSet;\n+import java.util.List;\n+\n+import org.apache.parquet.Preconditions;\n+import org.apache.parquet.bytes.*;\n+import org.apache.parquet.column.Encoding;\n+import org.apache.parquet.column.ParquetProperties;\n+import org.apache.parquet.io.ParquetEncodingException;\n+import org.apache.parquet.io.api.Binary;\n+import org.apache.parquet.schema.PrimitiveType;\n+\n+/**\n+ * Bloom Filter is a compact structure to indicate whether an item is not in set or probably\n+ * in set. Bloom class is underlying class of Bloom Filter which stores a bit set represents\n+ * elements set, hash strategy and bloom filter algorithm.\n+ *\n+ * Bloom Filter algorithm is implemented using block Bloom filters from Putze et al.'s \"Cache-,\n+ * Hash- and Space-Efficient Bloom Filters\". The basic idea is to hash the item to a tiny Bloom\n+ * Filter which size fit a single cache line or smaller. This implementation sets 8 bits in\n+ * each tiny Bloom Filter. Tiny bloom filter are 32 bytes to take advantage of 32-bytes SIMD\n+ * instruction.\n+ */\n+\n+public abstract class Bloom<T extends Comparable<T>> {\n+  // Hash strategy available for bloom filter.\n+  public enum HASH {\n+    MURMUR3_X64_128,\n+  }\n+\n+  // Bloom filter algorithm.\n+  public enum ALGORITHM {\n+    BLOCK,\n+  }\n+\n+  /**\n+   * Default false positive probability value use to calculate optimal number of bits\n+   * used by bloom filter.\n+   */\n+  public final double FPP = 0.01;\n+\n+  // Bloom filter data header, including number of bytes, hash strategy and algorithm.\n+  public static final int BLOOM_HEADER_SIZE = 12;\n+\n+  // Bytes in a bucket.\n+  public static final int BYTES_PER_BUCKET = 32;","path":"parquet-column/src/main/java/org/apache/parquet/column/values/bloom/Bloom.java","position":70,"original_position":70,"commit_id":"9bf76bdf588d9a2c4b770c4db85df4560b846aa2","original_commit_id":"9bf76bdf588d9a2c4b770c4db85df4560b846aa2","user":{"login":"jbapple-cloudera","id":13907602,"avatar_url":"https://avatars3.githubusercontent.com/u/13907602?v=4","gravatar_id":"","url":"https://api.github.com/users/jbapple-cloudera","html_url":"https://github.com/jbapple-cloudera","followers_url":"https://api.github.com/users/jbapple-cloudera/followers","following_url":"https://api.github.com/users/jbapple-cloudera/following{/other_user}","gists_url":"https://api.github.com/users/jbapple-cloudera/gists{/gist_id}","starred_url":"https://api.github.com/users/jbapple-cloudera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbapple-cloudera/subscriptions","organizations_url":"https://api.github.com/users/jbapple-cloudera/orgs","repos_url":"https://api.github.com/users/jbapple-cloudera/repos","events_url":"https://api.github.com/users/jbapple-cloudera/events{/privacy}","received_events_url":"https://api.github.com/users/jbapple-cloudera/received_events","type":"User","site_admin":false},"body":"Why do you need both BYTES_PER_BUCKET and MINIMUM_BLOOM_SIZE? Isn't the MINIMUM_BLOOM_SIZE one bucket?","created_at":"2017-09-14T05:42:21Z","updated_at":"2017-09-14T05:52:43Z","html_url":"https://github.com/apache/parquet-mr/pull/425#discussion_r138801251","pull_request_url":"https://api.github.com/repos/apache/parquet-mr/pulls/425","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/apache/parquet-mr/pulls/comments/138801251"},"html":{"href":"https://github.com/apache/parquet-mr/pull/425#discussion_r138801251"},"pull_request":{"href":"https://api.github.com/repos/apache/parquet-mr/pulls/425"}}},"pull_request":{"url":"https://api.github.com/repos/apache/parquet-mr/pulls/425","id":139269267,"html_url":"https://github.com/apache/parquet-mr/pull/425","diff_url":"https://github.com/apache/parquet-mr/pull/425.diff","patch_url":"https://github.com/apache/parquet-mr/pull/425.patch","issue_url":"https://api.github.com/repos/apache/parquet-mr/issues/425","number":425,"state":"open","locked":false,"title":"PARQUET-41:Add Bloom Filter for parquet","user":{"login":"cjjnjust","id":3960228,"avatar_url":"https://avatars1.githubusercontent.com/u/3960228?v=4","gravatar_id":"","url":"https://api.github.com/users/cjjnjust","html_url":"https://github.com/cjjnjust","followers_url":"https://api.github.com/users/cjjnjust/followers","following_url":"https://api.github.com/users/cjjnjust/following{/other_user}","gists_url":"https://api.github.com/users/cjjnjust/gists{/gist_id}","starred_url":"https://api.github.com/users/cjjnjust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjjnjust/subscriptions","organizations_url":"https://api.github.com/users/cjjnjust/orgs","repos_url":"https://api.github.com/users/cjjnjust/repos","events_url":"https://api.github.com/users/cjjnjust/events{/privacy}","received_events_url":"https://api.github.com/users/cjjnjust/received_events","type":"User","site_admin":false},"body":"This is an initial patch just include bloom filter itself.\r\n\r\n\r\n","created_at":"2017-09-05T08:52:23Z","updated_at":"2017-09-14T05:52:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f790f4649b78ee1767d006faf4cf089b34404e39","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/parquet-mr/pulls/425/commits","review_comments_url":"https://api.github.com/repos/apache/parquet-mr/pulls/425/comments","review_comment_url":"https://api.github.com/repos/apache/parquet-mr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/parquet-mr/issues/425/comments","statuses_url":"https://api.github.com/repos/apache/parquet-mr/statuses/9bf76bdf588d9a2c4b770c4db85df4560b846aa2","head":{"label":"cjjnjust:parquet-41","ref":"parquet-41","sha":"9bf76bdf588d9a2c4b770c4db85df4560b846aa2","user":{"login":"cjjnjust","id":3960228,"avatar_url":"https://avatars1.githubusercontent.com/u/3960228?v=4","gravatar_id":"","url":"https://api.github.com/users/cjjnjust","html_url":"https://github.com/cjjnjust","followers_url":"https://api.github.com/users/cjjnjust/followers","following_url":"https://api.github.com/users/cjjnjust/following{/other_user}","gists_url":"https://api.github.com/users/cjjnjust/gists{/gist_id}","starred_url":"https://api.github.com/users/cjjnjust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjjnjust/subscriptions","organizations_url":"https://api.github.com/users/cjjnjust/orgs","repos_url":"https://api.github.com/users/cjjnjust/repos","events_url":"https://api.github.com/users/cjjnjust/events{/privacy}","received_events_url":"https://api.github.com/users/cjjnjust/received_events","type":"User","site_admin":false},"repo":{"id":101361250,"name":"parquet-mr","full_name":"cjjnjust/parquet-mr","owner":{"login":"cjjnjust","id":3960228,"avatar_url":"https://avatars1.githubusercontent.com/u/3960228?v=4","gravatar_id":"","url":"https://api.github.com/users/cjjnjust","html_url":"https://github.com/cjjnjust","followers_url":"https://api.github.com/users/cjjnjust/followers","following_url":"https://api.github.com/users/cjjnjust/following{/other_user}","gists_url":"https://api.github.com/users/cjjnjust/gists{/gist_id}","starred_url":"https://api.github.com/users/cjjnjust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjjnjust/subscriptions","organizations_url":"https://api.github.com/users/cjjnjust/orgs","repos_url":"https://api.github.com/users/cjjnjust/repos","events_url":"https://api.github.com/users/cjjnjust/events{/privacy}","received_events_url":"https://api.github.com/users/cjjnjust/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cjjnjust/parquet-mr","description":"Mirror of Apache Parquet","fork":true,"url":"https://api.github.com/repos/cjjnjust/parquet-mr","forks_url":"https://api.github.com/repos/cjjnjust/parquet-mr/forks","keys_url":"https://api.github.com/repos/cjjnjust/parquet-mr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cjjnjust/parquet-mr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cjjnjust/parquet-mr/teams","hooks_url":"https://api.github.com/repos/cjjnjust/parquet-mr/hooks","issue_events_url":"https://api.github.com/repos/cjjnjust/parquet-mr/issues/events{/number}","events_url":"https://api.github.com/repos/cjjnjust/parquet-mr/events","assignees_url":"https://api.github.com/repos/cjjnjust/parquet-mr/assignees{/user}","branches_url":"https://api.github.com/repos/cjjnjust/parquet-mr/branches{/branch}","tags_url":"https://api.github.com/repos/cjjnjust/parquet-mr/tags","blobs_url":"https://api.github.com/repos/cjjnjust/parquet-mr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cjjnjust/parquet-mr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cjjnjust/parquet-mr/git/refs{/sha}","trees_url":"https://api.github.com/repos/cjjnjust/parquet-mr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cjjnjust/parquet-mr/statuses/{sha}","languages_url":"https://api.github.com/repos/cjjnjust/parquet-mr/languages","stargazers_url":"https://api.github.com/repos/cjjnjust/parquet-mr/stargazers","contributors_url":"https://api.github.com/repos/cjjnjust/parquet-mr/contributors","subscribers_url":"https://api.github.com/repos/cjjnjust/parquet-mr/subscribers","subscription_url":"https://api.github.com/repos/cjjnjust/parquet-mr/subscription","commits_url":"https://api.github.com/repos/cjjnjust/parquet-mr/commits{/sha}","git_commits_url":"https://api.github.com/repos/cjjnjust/parquet-mr/git/commits{/sha}","comments_url":"https://api.github.com/repos/cjjnjust/parquet-mr/comments{/number}","issue_comment_url":"https://api.github.com/repos/cjjnjust/parquet-mr/issues/comments{/number}","contents_url":"https://api.github.com/repos/cjjnjust/parquet-mr/contents/{+path}","compare_url":"https://api.github.com/repos/cjjnjust/parquet-mr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cjjnjust/parquet-mr/merges","archive_url":"https://api.github.com/repos/cjjnjust/parquet-mr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cjjnjust/parquet-mr/downloads","issues_url":"https://api.github.com/repos/cjjnjust/parquet-mr/issues{/number}","pulls_url":"https://api.github.com/repos/cjjnjust/parquet-mr/pulls{/number}","milestones_url":"https://api.github.com/repos/cjjnjust/parquet-mr/milestones{/number}","notifications_url":"https://api.github.com/repos/cjjnjust/parquet-mr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cjjnjust/parquet-mr/labels{/name}","releases_url":"https://api.github.com/repos/cjjnjust/parquet-mr/releases{/id}","deployments_url":"https://api.github.com/repos/cjjnjust/parquet-mr/deployments","created_at":"2017-08-25T03:16:05Z","updated_at":"2017-08-25T03:16:59Z","pushed_at":"2017-09-14T05:18:03Z","git_url":"git://github.com/cjjnjust/parquet-mr.git","ssh_url":"git@github.com:cjjnjust/parquet-mr.git","clone_url":"https://github.com/cjjnjust/parquet-mr.git","svn_url":"https://github.com/cjjnjust/parquet-mr","homepage":null,"size":14604,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"ddbeb4dd17d9c219b99b1e66d8be28efe37e3aa6","user":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":20675636,"name":"parquet-mr","full_name":"apache/parquet-mr","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/parquet-mr","description":"Mirror of Apache Parquet","fork":false,"url":"https://api.github.com/repos/apache/parquet-mr","forks_url":"https://api.github.com/repos/apache/parquet-mr/forks","keys_url":"https://api.github.com/repos/apache/parquet-mr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/parquet-mr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/parquet-mr/teams","hooks_url":"https://api.github.com/repos/apache/parquet-mr/hooks","issue_events_url":"https://api.github.com/repos/apache/parquet-mr/issues/events{/number}","events_url":"https://api.github.com/repos/apache/parquet-mr/events","assignees_url":"https://api.github.com/repos/apache/parquet-mr/assignees{/user}","branches_url":"https://api.github.com/repos/apache/parquet-mr/branches{/branch}","tags_url":"https://api.github.com/repos/apache/parquet-mr/tags","blobs_url":"https://api.github.com/repos/apache/parquet-mr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/parquet-mr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/parquet-mr/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/parquet-mr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/parquet-mr/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/parquet-mr/languages","stargazers_url":"https://api.github.com/repos/apache/parquet-mr/stargazers","contributors_url":"https://api.github.com/repos/apache/parquet-mr/contributors","subscribers_url":"https://api.github.com/repos/apache/parquet-mr/subscribers","subscription_url":"https://api.github.com/repos/apache/parquet-mr/subscription","commits_url":"https://api.github.com/repos/apache/parquet-mr/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/parquet-mr/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/parquet-mr/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/parquet-mr/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/parquet-mr/contents/{+path}","compare_url":"https://api.github.com/repos/apache/parquet-mr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/parquet-mr/merges","archive_url":"https://api.github.com/repos/apache/parquet-mr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/parquet-mr/downloads","issues_url":"https://api.github.com/repos/apache/parquet-mr/issues{/number}","pulls_url":"https://api.github.com/repos/apache/parquet-mr/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/parquet-mr/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/parquet-mr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/parquet-mr/labels{/name}","releases_url":"https://api.github.com/repos/apache/parquet-mr/releases{/id}","deployments_url":"https://api.github.com/repos/apache/parquet-mr/deployments","created_at":"2014-06-10T07:00:07Z","updated_at":"2017-09-12T14:58:11Z","pushed_at":"2017-09-14T05:18:05Z","git_url":"git://github.com/apache/parquet-mr.git","ssh_url":"git@github.com:apache/parquet-mr.git","clone_url":"https://github.com/apache/parquet-mr.git","svn_url":"https://github.com/apache/parquet-mr","homepage":null,"size":14544,"stargazers_count":450,"watchers_count":450,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":363,"mirror_url":"git://git.apache.org/parquet-mr.git","open_issues_count":61,"forks":363,"open_issues":61,"watchers":450,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/parquet-mr/pulls/425"},"html":{"href":"https://github.com/apache/parquet-mr/pull/425"},"issue":{"href":"https://api.github.com/repos/apache/parquet-mr/issues/425"},"comments":{"href":"https://api.github.com/repos/apache/parquet-mr/issues/425/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/parquet-mr/pulls/425/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/parquet-mr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/parquet-mr/pulls/425/commits"},"statuses":{"href":"https://api.github.com/repos/apache/parquet-mr/statuses/9bf76bdf588d9a2c4b770c4db85df4560b846aa2"}},"author_association":"NONE"}}
{"actor":{"display_login":"jbapple-cloudera"}}