Commit dadc47c
Fix null-aware anti join with shared atomic state for partitioned execution
The previous implementation used per-partition flags to track probe side state,
which caused incorrect results when hash partitioning distributed rows across
multiple partitions. With CollectLeft mode, each output partition only had local
knowledge of its own probe data, not global state.
This commit fixes the issue by:
1. Adding shared AtomicBool flags to JoinLeftData (probe_side_non_empty, probe_side_has_null)
2. All partitions write to and read from these shared atomic flags
3. Ensures global knowledge of probe side state across all partitions
Example of the bug:
- With 16 partitions, NULL rows hash to partition 5, value 2 hashes to partition 12
- Partition 5 sees no probe data (local view: empty)
- Partition 12 sees probe data (local view: non-empty)
- If partition 5 outputs final results, it incorrectly returns NULL rows
With shared atomic state, partition 5 now sees the global truth and correctly
filters NULL rows when probe side is non-empty.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>1 parent 537fc50 commit dadc47c
2 files changed
+22
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
121 | 126 | | |
122 | 127 | | |
123 | 128 | | |
| |||
1585 | 1590 | | |
1586 | 1591 | | |
1587 | 1592 | | |
| 1593 | + | |
| 1594 | + | |
1588 | 1595 | | |
1589 | 1596 | | |
1590 | 1597 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | 229 | | |
237 | 230 | | |
238 | 231 | | |
| |||
413 | 406 | | |
414 | 407 | | |
415 | 408 | | |
416 | | - | |
417 | | - | |
418 | 409 | | |
419 | 410 | | |
420 | 411 | | |
| |||
613 | 604 | | |
614 | 605 | | |
615 | 606 | | |
| 607 | + | |
616 | 608 | | |
617 | | - | |
| 609 | + | |
618 | 610 | | |
619 | 611 | | |
620 | 612 | | |
621 | 613 | | |
622 | 614 | | |
623 | | - | |
624 | | - | |
625 | | - | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
626 | 618 | | |
627 | 619 | | |
628 | | - | |
629 | | - | |
| 620 | + | |
| 621 | + | |
630 | 622 | | |
631 | 623 | | |
632 | 624 | | |
| |||
784 | 776 | | |
785 | 777 | | |
786 | 778 | | |
| 779 | + | |
| 780 | + | |
787 | 781 | | |
788 | | - | |
| 782 | + | |
| 783 | + | |
789 | 784 | | |
790 | 785 | | |
791 | 786 | | |
792 | 787 | | |
793 | | - | |
794 | | - | |
795 | 788 | | |
796 | 789 | | |
797 | 790 | | |
| |||
807 | 800 | | |
808 | 801 | | |
809 | 802 | | |
| 803 | + | |
810 | 804 | | |
811 | 805 | | |
812 | | - | |
| 806 | + | |
813 | 807 | | |
814 | 808 | | |
815 | 809 | | |
| |||
0 commit comments