Commit c875ef9
authored
repro and disable dyn filter for preserve file partitions (#20175)
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate
change logs for our releases. You can link an issue to this PR using the
GitHub syntax. For example `Closes
#123` indicates that this PR will close issue #123.
-->
- Closes #20176
- Discussed this with @adriangb
## Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not
needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better
suggestions for fixes.
-->
Dynamic filter pushdown can produce incorrect results when
`preserve_file_partitions` is enabled and a partitioned hash join is
used. The file groups are Hive‑partitioned (value‑based) but reported as
hash‑partitioned, so hash‑routed dynamic filters can drop valid rows.
## What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary
of the individual changes in this PR.
-->
- Disable join dynamic filter pushdown for `PartitionMode::Partitioned`
when `preserve_file_partitions > 0`.
- Add two sqllogictests that reproduce the issue and validate the fix.
## Are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
-->
- `cargo test --test sqllogictests -- preserve_file_partitioning` ->
will pass
- `git checkout main
datafusion/physical-plan/src/joins/hash_join/exec.rs`
- `cargo test --test sqllogictests -- preserve_file_partitioning` ->
will fail
## Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
-->
Join dynamic filter pushdown is disabled when `preserve_file_partitions`
is enabled and the join is partitioned.
<!--
If there are any breaking changes to public APIs, please add the `api
change` label.
-->
cc: @NGA-TRAN @gabotechs1 parent 48d20ad commit c875ef9
2 files changed
Lines changed: 151 additions & 6 deletions
File tree
- datafusion
- physical-plan/src/joins/hash_join
- sqllogictest/test_files
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
719 | 719 | | |
720 | 720 | | |
721 | 721 | | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
722 | 742 | | |
723 | 743 | | |
724 | 744 | | |
| |||
1179 | 1199 | | |
1180 | 1200 | | |
1181 | 1201 | | |
1182 | | - | |
1183 | | - | |
1184 | | - | |
1185 | | - | |
1186 | | - | |
| 1202 | + | |
| 1203 | + | |
1187 | 1204 | | |
1188 | 1205 | | |
1189 | 1206 | | |
| |||
1413 | 1430 | | |
1414 | 1431 | | |
1415 | 1432 | | |
1416 | | - | |
| 1433 | + | |
1417 | 1434 | | |
1418 | 1435 | | |
1419 | 1436 | | |
| |||
Lines changed: 128 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
104 | 127 | | |
105 | 128 | | |
106 | 129 | | |
| |||
173 | 196 | | |
174 | 197 | | |
175 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
176 | 206 | | |
177 | 207 | | |
178 | 208 | | |
| |||
579 | 609 | | |
580 | 610 | | |
581 | 611 | | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
582 | 707 | | |
583 | 708 | | |
584 | 709 | | |
| |||
592 | 717 | | |
593 | 718 | | |
594 | 719 | | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
595 | 723 | | |
596 | 724 | | |
0 commit comments