You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "XinyuZeng (via GitHub)" <gi...@apache.org> on 2023/02/18 09:48:42 UTC
[GitHub] [arrow-rs] XinyuZeng commented on a diff in pull request #3119: parquet bloom filter part III: add sbbf writer, remove `bloom` default feature, add reader properties
XinyuZeng commented on code in PR #3119:
URL: https://github.com/apache/arrow-rs/pull/3119#discussion_r1110973057
##########
parquet/src/bloom_filter/mod.rs:
##########
@@ -113,7 +116,48 @@ fn read_bloom_filter_header_and_length(
))
}
+const BITSET_MIN_LENGTH: usize = 32;
+const BITSET_MAX_LENGTH: usize = 128 * 1024 * 1024;
+
+#[inline]
+fn optimal_num_of_bytes(num_bytes: usize) -> usize {
+ let num_bytes = num_bytes.min(BITSET_MAX_LENGTH);
+ let num_bytes = num_bytes.max(BITSET_MIN_LENGTH);
+ num_bytes.next_power_of_two()
+}
+
+// see http://algo2.iti.kit.edu/documents/cacheefficientbloomfilters-jea.pdf
Review Comment:
@Jimexist Wondering why here we round num_bytes to next power of two? parquet-mr just rounds to (k * BITS_PER_BLOCK)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org