Skip to content

fix: [branch-1.2] merge all Bloom filter states and respect sliced offsets (#7173) - #7644

Open
andygrove wants to merge 1 commit into
apache:branch-1.2from
andygrove:backport-7173-branch-1.2
Open

andygrove wants to merge 1 commit into
apache:branch-1.2from
andygrove:backport-7173-branch-1.2

Conversation

@andygrove

@andygrove andygrove commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Which issue does this PR close?

Backport of #7173 to branch-1.2. Closes #7172 on this branch.

Rationale for this change

A final Bloom filter aggregate can receive several partial filters for one group in a single input batch. branch-1.2's merge_batch asserts that the state array holds exactly one row, so such a batch panics the native task. Reading BinaryArray::value_data() can also merge another group's filter when a grouped input is a slice that starts at a nonzero offset. See #7173 and #7172 for the full analysis.

What changes are included in this PR?

Cherry-pick of 383ec56 (git cherry-pick -x) with no conflicts and no adaptations. It merges each non-null binary row of the state array using its own byte slice, and adds unit tests in bloom_filter_agg.rs plus the integration test native/spark-expr/tests/bloom_filter_merge.rs. The diff against the source commit is identical apart from line numbers and blob hashes.

Other release branches: branch-1.2 is the newest release branch, so there is no newer one to port to.

How are these changes tested?

On this branch, with JDK 17: the 33 Bloom filter unit tests in datafusion-comet-spark-expr and the new bloom_filter_merge integration test pass, and cargo check --all-targets -p datafusion-comet-spark-expr and cargo fmt --check are clean. With bloom_filter_agg.rs restored to branch-1.2's version, grouped_final_bloom_filter_merges_batched_states panics on that one-row assertion (left: 2, right: 1), so the branch has the bug and the test catches it. The change is Rust only, so I did not run any JVM suites.

…#7173)

* fix: merge all Bloom filter states and respect sliced offsets

* test: cover batched Bloom states in default final aggregation

(cherry picked from commit 383ec56)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants