Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
3c5a843
SPARK-47547 BloomFilter fpp degradation: addressing the int32 truncation
ishnagy May 12, 2025
08cbfeb
SPARK-47547 BloomFilter fpp degradation: fixing test data repetition …
ishnagy May 13, 2025
e3cb08e
SPARK-47547 BloomFilter fpp degradation: scrambling the high 32bytes …
ishnagy May 13, 2025
c4e3f58
SPARK-47547 BloomFilter fpp degradation: random distribution fpp test
ishnagy May 13, 2025
1a0b66f
SPARK-47547 BloomFilter fpp degradation: javadoc for test methods, ch…
ishnagy May 19, 2025
d912b66
SPARK-47547 BloomFilter fpp degradation: make seed serialization back…
ishnagy May 19, 2025
f589e2c
SPARK-47547 BloomFilter fpp degradation: counting discarded odd items…
ishnagy May 19, 2025
f597c76
SPARK-47547 BloomFilter fpp degradation: refactoring FPP counting log…
ishnagy May 19, 2025
4ea633d
SPARK-47547 BloomFilter fpp degradation: checkstyle fix
ishnagy May 19, 2025
6696106
SPARK-47547 BloomFilter fpp degradation: fix test bug
ishnagy May 21, 2025
b75e187
SPARK-47547 BloomFilter fpp degradation: parallelization friendly tes…
ishnagy May 26, 2025
2d8a9f1
SPARK-47547 BloomFilter fpp degradation: parallelization friendly tes…
ishnagy May 26, 2025
4a30794
SPARK-47547 BloomFilter fpp degradation: parallelization friendly tes…
ishnagy May 26, 2025
d9d6980
SPARK-47547 BloomFilter fpp degradation: addressing concerns around d…
ishnagy Jun 16, 2025
39a46c9
SPARK-47547 BloomFilter fpp degradation: cut down test cases to decre…
ishnagy Jun 17, 2025
7f235e7
Merge branch 'master' into SPARK-47547_bloomfilter_fpp_degradation
ishnagy Jun 17, 2025
16be3a9
SPARK-47547 BloomFilter fpp degradation: revert creating a new SlowTe…
ishnagy Jun 17, 2025
e91b5ca
SPARK-47547 BloomFilter fpp degradation: disable progress logging by …
ishnagy Jun 17, 2025
897c1d4
SPARK-47547 BloomFilter fpp degradation: adjust tolerance and fail on…
ishnagy Jun 18, 2025
013bfe4
SPARK-47547 BloomFilter fpp degradation: make V1/V2 distinction in Bl…
ishnagy Jul 6, 2025
6d44c1e
SPARK-47547 BloomFilter fpp degradation: scrambling test input withou…
ishnagy Jul 6, 2025
925bf12
SPARK-47547 BloomFilter fpp degradation: parallelizing BloomFilter re…
ishnagy Jul 6, 2025
6f28882
SPARK-47547 BloomFilter fpp degradation: add seed to equals/hashCode
ishnagy Jul 7, 2025
ed6caac
SPARK-47547 BloomFilter fpp degradation: checkstyle fix
ishnagy Jul 7, 2025
7d4ef74
SPARK-47547 BloomFilter fpp degradation: remove dependency between lo…
ishnagy Jul 7, 2025
c52ead3
Merge branch 'master' into SPARK-47547_bloomfilter_fpp_degradation
ishnagy Jul 7, 2025
0ab8276
SPARK-47547 BloomFilter fpp degradation: running /dev/scalafmt
ishnagy Jul 7, 2025
d2477bf
SPARK-47547 BloomFilter fpp degradation: javadoc comment for the V2 enum
ishnagy Jul 7, 2025
413c4fe
SPARK-47547 BloomFilter fpp degradation: reindent with 2 spaces
ishnagy Jul 7, 2025
4599fcb
SPARK-47547 BloomFilter fpp degradation: (recover empty line in Bloom…
ishnagy Jul 7, 2025
1ee2e13
SPARK-47547 BloomFilter fpp degradation: JEP-361 style switches
ishnagy Jul 7, 2025
c501b2a
SPARK-47547 BloomFilter fpp degradation: removing Objects::equals
ishnagy Jul 7, 2025
1f5cfb6
SPARK-47547 BloomFilter fpp degradation: add missing seed comparison …
ishnagy Jul 7, 2025
f60d55f
SPARK-47547 BloomFilter fpp degradation: checkstyle
ishnagy Jul 8, 2025
0314963
SPARK-47547 BloomFilter fpp degradation: BloomFilterBase abstract par…
ishnagy Jul 11, 2025
f2df338
SPARK-47547 BloomFilter fpp degradation: pull up long and byte hashin…
ishnagy Jul 11, 2025
4aaff83
SPARK-47547 BloomFilter fpp degradation: checkstyle
ishnagy Jul 13, 2025
e214bd7
SPARK-47547 BloomFilter fpp degradation: removing unnecessary line wr…
ishnagy Jul 15, 2025
99f7343
SPARK-47547 BloomFilter fpp degradation: moving junit-pioneer version…
ishnagy Jul 15, 2025
58e3066
SPARK-47547 BloomFilter fpp degradation: (empty line juggling)
ishnagy Jul 15, 2025
c06cb38
SPARK-47547 BloomFilter fpp degradation: pull up common hash scatteri…
ishnagy Jul 15, 2025
b99ef3a
SPARK-47547 BloomFilter fpp degradation: (empty line juggling)
ishnagy Jul 15, 2025
ce3ad76
SPARK-47547 BloomFilter fpp degradation: remove redundant default cas…
ishnagy Jul 15, 2025
626e459
SPARK-47547 BloomFilter fpp degradation: properly capitalize InputStr…
ishnagy Jul 15, 2025
b0f5b45
SPARK-47547 BloomFilter fpp degradation: indenting method parameters …
ishnagy Jul 15, 2025
6849dbe
SPARK-47547 BloomFilter fpp degradation: removing junit-pioneer from …
ishnagy Jul 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
SPARK-47547 BloomFilter fpp degradation: pull up long and byte hashin…
…g to abstract base to make them extensible
  • Loading branch information
ishnagy committed Jul 11, 2025
commit f2df338faa77e9d1ddbd6bbd04f12c22bb72ceeb
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,23 @@ public long cardinality() {
protected abstract BloomFilterBase checkCompatibilityForMerge(BloomFilter other)
throws IncompatibleMergeException;

public record HiLoHash (int hi, int lo) {}

protected HiLoHash hashLongToIntPair(long item, int seed) {
// Here we first hash the input long element into 2 int hash values, h1 and h2, then produce n
// hash values by `h1 + i * h2` with 1 <= i <= numHashFunctions.
// Note that `CountMinSketch` use a different strategy, it hash the input long element with
// every i to produce n hash values.
// TODO: the strategy of `CountMinSketch` looks more advanced, should we follow it here?
int h1 = Murmur3_x86_32.hashLong(item, seed);
int h2 = Murmur3_x86_32.hashLong(item, h1);
return new HiLoHash(h1, h2);
}

protected HiLoHash hashBytesToIntPair(byte[] item, int seed) {
int h1 = Murmur3_x86_32.hashUnsafeBytes(item, Platform.BYTE_ARRAY_OFFSET, item.length, seed);
int h2 = Murmur3_x86_32.hashUnsafeBytes(item, Platform.BYTE_ARRAY_OFFSET, item.length, h1);
return new HiLoHash(h1, h2);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ private BloomFilterImpl() {}

@Override
public boolean putBinary(byte[] item) {
int h1 = Murmur3_x86_32.hashUnsafeBytes(item, Platform.BYTE_ARRAY_OFFSET, item.length, 0);
int h2 = Murmur3_x86_32.hashUnsafeBytes(item, Platform.BYTE_ARRAY_OFFSET, item.length, h1);
HiLoHash hiLoHash = hashBytesToIntPair(item, seed);
int h1 = hiLoHash.hi();
int h2 = hiLoHash.lo();

long bitSize = bits.bitSize();
boolean bitsChanged = false;
Expand All @@ -47,8 +48,9 @@ public boolean putBinary(byte[] item) {

@Override
public boolean mightContainBinary(byte[] item) {
int h1 = Murmur3_x86_32.hashUnsafeBytes(item, Platform.BYTE_ARRAY_OFFSET, item.length, 0);
int h2 = Murmur3_x86_32.hashUnsafeBytes(item, Platform.BYTE_ARRAY_OFFSET, item.length, h1);
HiLoHash hiLoHash = hashBytesToIntPair(item, seed);
int h1 = hiLoHash.hi();
int h2 = hiLoHash.lo();

long bitSize = bits.bitSize();
for (int i = 1; i <= numHashFunctions; i++) {
Expand All @@ -66,13 +68,9 @@ public boolean mightContainBinary(byte[] item) {

@Override
public boolean putLong(long item) {
// Here we first hash the input long element into 2 int hash values, h1 and h2, then produce n
// hash values by `h1 + i * h2` with 1 <= i <= numHashFunctions.
// Note that `CountMinSketch` use a different strategy, it hash the input long element with
// every i to produce n hash values.
// TODO: the strategy of `CountMinSketch` looks more advanced, should we follow it here?
int h1 = Murmur3_x86_32.hashLong(item, 0);
int h2 = Murmur3_x86_32.hashLong(item, h1);
HiLoHash hiLoHash = hashLongToIntPair(item, seed);
int h1 = hiLoHash.hi();
int h2 = hiLoHash.lo();

long bitSize = bits.bitSize();
boolean bitsChanged = false;
Expand All @@ -89,8 +87,9 @@ public boolean putLong(long item) {

@Override
public boolean mightContainLong(long item) {
int h1 = Murmur3_x86_32.hashLong(item, 0);
int h2 = Murmur3_x86_32.hashLong(item, h1);
HiLoHash hiLoHash = hashLongToIntPair(item, seed);
int h1 = hiLoHash.hi();
int h2 = hiLoHash.lo();

long bitSize = bits.bitSize();
for (int i = 1; i <= numHashFunctions; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ public boolean equals(Object other) {

@Override
public boolean putBinary(byte[] item) {
int h1 = Murmur3_x86_32.hashUnsafeBytes(item, Platform.BYTE_ARRAY_OFFSET, item.length, seed);
int h2 = Murmur3_x86_32.hashUnsafeBytes(item, Platform.BYTE_ARRAY_OFFSET, item.length, h1);
HiLoHash hiLoHash = hashBytesToIntPair(item, seed);
int h1 = hiLoHash.hi();
int h2 = hiLoHash.lo();

long bitSize = bits.bitSize();
boolean bitsChanged = false;
Expand All @@ -70,8 +71,9 @@ public boolean putBinary(byte[] item) {

@Override
public boolean mightContainBinary(byte[] item) {
int h1 = Murmur3_x86_32.hashUnsafeBytes(item, Platform.BYTE_ARRAY_OFFSET, item.length, seed);
int h2 = Murmur3_x86_32.hashUnsafeBytes(item, Platform.BYTE_ARRAY_OFFSET, item.length, h1);
HiLoHash hiLoHash = hashBytesToIntPair(item, seed);
int h1 = hiLoHash.hi();
int h2 = hiLoHash.lo();

long bitSize = bits.bitSize();

Expand All @@ -92,13 +94,9 @@ public boolean mightContainBinary(byte[] item) {

@Override
public boolean putLong(long item) {
// Here we first hash the input long element into 2 int hash values, h1 and h2, then produce n
// hash values by `h1 + i * h2` with 1 <= i <= numHashFunctions.
// Note that `CountMinSketch` use a different strategy, it hash the input long element with
// every i to produce n hash values.
// TODO: the strategy of `CountMinSketch` looks more advanced, should we follow it here?
int h1 = Murmur3_x86_32.hashLong(item, seed);
int h2 = Murmur3_x86_32.hashLong(item, h1);
HiLoHash hiLoHash = hashLongToIntPair(item, seed);
int h1 = hiLoHash.hi();
int h2 = hiLoHash.lo();

long bitSize = bits.bitSize();
boolean bitsChanged = false;
Expand All @@ -118,8 +116,9 @@ public boolean putLong(long item) {

@Override
public boolean mightContainLong(long item) {
int h1 = Murmur3_x86_32.hashLong(item, seed);
int h2 = Murmur3_x86_32.hashLong(item, h1);
HiLoHash hiLoHash = hashLongToIntPair(item, seed);
int h1 = hiLoHash.hi();
int h2 = hiLoHash.lo();

long bitSize = bits.bitSize();

Expand Down