Skip to content

Commit 4a6f6ea

Browse files
committed
Clarify BloomFilter mixed-mode scope.
Document that the buffer-conversion path is a defensive fix for a rare mixed CPU/GPU plan and explain how the regression test intentionally forces that scenario. Made-with: Cursor
1 parent 2b8bdbd commit 4a6f6ea

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

sql-plugin/src/main/spark330/scala/com/nvidia/spark/rapids/shims/BloomFilterShims.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ object BloomFilterShims {
102102
aggBuffer.copy(dataType = a.dataType)(aggBuffer.exprId, aggBuffer.qualifier)
103103
}
104104

105+
// This is a defensive correctness fix for the rare mixed CPU/GPU bridge path.
105106
// BloomFilterAggregate crosses the CPU/GPU boundary as BinaryType in both directions,
106107
// but empty GPU partial buffers can be null while Spark CPU final expects a serialized
107108
// empty bloom filter. We still need a converter even though the runtime type

tests/src/test/spark330/scala/com/nvidia/spark/rapids/BloomFilterAggregateQuerySuiteBase.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ trait BloomFilterAggregateQuerySuiteBase extends SparkQueryCompareTestSuite {
150150

151151
// Keep the empty-partition mixed CPU/GPU regression coverage in the shared base so both the
152152
// 3.3x/3.5x suites and the 4.1.1 suite exercise the same bridge behavior.
153+
// This is a defensive correctness path that is unlikely in normal workloads because a supported
154+
// BloomFilterAggregate would normally keep both partial and final stages on GPU.
155+
// The test forces the mixed plan on purpose: BloomFilterMightContain falls back to CPU,
156+
// hashAgg.replaceMode keeps only one aggregate stage on GPU, AQE stays off so the plan shape is
157+
// stable, and extra shuffle partitions guarantee empty build partitions.
153158
for (mode <- Seq("partial", "final")) {
154159
ALLOW_NON_GPU_testSparkResultsAreEqualWithCapture(
155160
s"might_contain GPU $mode build CPU probe with empty build partitions",

0 commit comments

Comments
 (0)