peter-toth commented on code in PR #59599:
URL: https://github.com/apache/spark/pull/59599#discussion_r4339248474
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/EnsureRequirements.scala:
##########
@@ -347,8 +352,8 @@ case class EnsureRequirements(
// Sort 'commonPartitionValues' and use this mechanism to ensure
BatchScan's
// output partitions are ordered
val sorted = partitionValues.sorted(partitionOrdering)
- populateCommonPartitionInfo(plan, sorted.map((_, 1)),
- None, None, applyPartialClustering = false, replicatePartitions =
false)
+ populateSpjParams(plan, Some(sorted.map((_, 1))), None,
Review Comment:
**Finding 8.** `populateCommonPartitionInfo` reset `joinKeyPositions` and
`reducers` to `None` here. `populateSpjParams` keeps the existing ones, since
`composeJoinKeyPositions(existing, None)` returns `existing` and
`None.orElse(existing.reducers)` keeps the reducers. So an `ORDER BY` over a
key-grouped scan that already carries SPJ parameters now keeps them while the
sorted values are pushed on top. That may well be more correct, but it is
outside the description and has no test. Could you either keep the old reset
here, or mention the change and add a test for it?
---
_Generated by [Claude Code](https://claude.ai/code)_
--
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]