Uh oh!
There was an error while loading. Please reload this page.
[SPARK-56164][SQL] Fix SPJ merged key ordering - #54961
Conversation
peter-toth
commented
Mar 23, 2026
cc @szehon-ho , @dongjoon-hyun |
There was a problem hiding this comment.
Thank you, @peter-toth . This is only for 4.2.0, right?
This PR fixes a theoretical bug, a real world example is unlikely to exist.
Yes, I intend to fix in 4.2 only. I'm working on a new feature that can make this bug appear in real world scenarios. |
Uh oh!
There was an error while loading. Please reload this page.
dongjoon-hyun
left a comment
There was a problem hiding this comment.
+1, LGTM (with only one nit naming comment).
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
3eb6436 to
5daa4a7Comparepeter-toth
commented
Mar 24, 2026
Thank you @dongjoon-hyun and @szehon-ho for the review. Merged to |
What changes were proposed in this pull request?
Fix a bug in
EnsureRequirementswhere the ordering used to merge and dedup partition keys after reduction was based on the original partition key types rather than the reduced types.When compatible partition transform reducers are applied (e.g. reducing days keys to years keys), the resulting partition key values may have a different
DataTypethan the originals.Please note that #54884 fixed the issue when left and right side reduced key types are not equal, but this PR fixes the issue when the common reduced types differ to the left side original types.
Why are the changes needed?
Without this fix, when reducers change the data type of partition keys (e.g.
DateType→LongType), the ordering used to merge partition values is built for the wrong type, which can produce incorrect merge results or runtime failures during storage-partitioned joins with compatible transform reducers.Does this PR introduce any user-facing change?
This PR fixes a theoretical bug, a real world example is unlikely to exist.
How was this patch tested?
Added a new test case.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Sonnet 4.6