Commit ab2a069
[SPARK-56182][SQL] Allow SPJ reducing identity to other transforms
### What changes were proposed in this pull request?
Extended `KeyedShuffleSpec` to support storage-partitioned joins (SPJ) where one side uses an identity transform (represented as `AttributeReference`) and the other side uses an arbitrary `TransformExpression`.
### Why are the changes needed?
Previously, SPJ with compatible transform reduction only worked for `(TransformExpression, TransformExpression)` pairs. If one data source partitions by identity and the other by an arbitrary transform (e.g. bucket), SPJ was not triggered even though the identity side's raw values can be reduced by simply applying the transform.
### Does this PR introduce any user-facing change?
No.
### How was this patch tested?
Added new test case.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Sonnet 4.6
Closes #54980 from peter-toth/SPARK-56182-reduce-identity-to-other-transforms.
Authored-by: Peter Toth <peter.toth@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>1 parent f7c2cc4 commit ab2a069
2 files changed
Lines changed: 64 additions & 4 deletions
File tree
- sql
- catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/physical
- core/src/test/scala/org/apache/spark/sql/connector
Lines changed: 24 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1022 | 1022 | | |
1023 | 1023 | | |
1024 | 1024 | | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
1025 | 1030 | | |
1026 | 1031 | | |
1027 | 1032 | | |
| |||
1042 | 1047 | | |
1043 | 1048 | | |
1044 | 1049 | | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
1049 | 1069 | | |
1050 | 1070 | | |
1051 | 1071 | | |
| |||
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3528 | 3528 | | |
3529 | 3529 | | |
3530 | 3530 | | |
| 3531 | + | |
| 3532 | + | |
| 3533 | + | |
| 3534 | + | |
| 3535 | + | |
| 3536 | + | |
| 3537 | + | |
| 3538 | + | |
| 3539 | + | |
| 3540 | + | |
| 3541 | + | |
| 3542 | + | |
| 3543 | + | |
| 3544 | + | |
| 3545 | + | |
| 3546 | + | |
| 3547 | + | |
| 3548 | + | |
| 3549 | + | |
| 3550 | + | |
| 3551 | + | |
| 3552 | + | |
| 3553 | + | |
| 3554 | + | |
| 3555 | + | |
| 3556 | + | |
| 3557 | + | |
| 3558 | + | |
| 3559 | + | |
| 3560 | + | |
| 3561 | + | |
| 3562 | + | |
| 3563 | + | |
| 3564 | + | |
| 3565 | + | |
| 3566 | + | |
| 3567 | + | |
| 3568 | + | |
| 3569 | + | |
| 3570 | + | |
3531 | 3571 | | |
0 commit comments