dongjoon-hyun opened a new pull request, #58318: URL: https://github.com/apache/spark/pull/58318
### What changes were proposed in this pull request? Extract the ordering of grouped partition keys into a shared helper, `KeyedPartitioning.groupedKeyRowOrdering`, and use it from both `KeyedPartitioning.keyRowOrdering` (used by `toGrouped`, and thus by `createShuffleSpec`'s subset-keys branch) and `GroupPartitionsExec.groupAndSortByKeys`. Add a test pinning that the two orders agree. ### Why are the changes needed? With `spark.sql.sources.v2.bucketing.allowKeysSubsetOfPartitionKeys.enabled`, one join side may be shuffled onto the key order declared by `createShuffleSpec`, while the keyed side's physical layout is produced by `GroupPartitionsExec`. The two sorts must be identical, or the sides are silently mis-aligned at runtime. Today they agree only because both call `RowOrdering.createNaturalAscendingOrdering` on the same data types, and the requirement was recorded only in a comment -- the same comment-only ordering coupling that regressed in SPARK-59022. This PR is behavior-neutral and makes the contract shared, documented, and tested. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs with the newly added test case. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Fable 5 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
