File tree Expand file tree Collapse file tree
native/spark-expr/src/bloom_filter Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ use crate::bloom_filter::spark_bit_array::SparkBitArray;
2424use crate :: hash_funcs:: murmur3:: spark_compatible_murmur3_hash;
2525
2626const SPARK_BLOOM_FILTER_VERSION_1 : i32 = 1 ;
27+ const SPARK_BLOOM_FILTER_VERSION_2 : i32 = 2 ;
2728
2829/// A Bloom filter implementation that simulates the behavior of Spark's BloomFilter.
2930/// It's not a complete implementation of Spark's BloomFilter, but just add the minimum
@@ -60,9 +61,9 @@ impl From<&[u8]> for SparkBloomFilter {
6061 let mut offset = 0 ;
6162 let version = read_num_be_bytes ! ( i32 , 4 , buf[ offset..] ) ;
6263 offset += 4 ;
63- assert_eq ! (
64- version, SPARK_BLOOM_FILTER_VERSION_1 ,
65- "Unsupported BloomFilter version: {version}, expecting version: {SPARK_BLOOM_FILTER_VERSION_1}"
64+ assert ! (
65+ version == SPARK_BLOOM_FILTER_VERSION_1 || version == SPARK_BLOOM_FILTER_VERSION_2 ,
66+ "Unsupported BloomFilter version: {version}, expecting version: {SPARK_BLOOM_FILTER_VERSION_1} or {SPARK_BLOOM_FILTER_VERSION_2} "
6667 ) ;
6768 let num_hash_functions = read_num_be_bytes ! ( i32 , 4 , buf[ offset..] ) ;
6869 offset += 4 ;
You can’t perform that action at this time.
0 commit comments