ammarchalifah commented on code in PR #60295:
URL: https://github.com/apache/spark/pull/60295#discussion_r4535503565
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/EnsureRequirements.scala:
##########
@@ -192,8 +202,11 @@ case class EnsureRequirements(
// from one member, otherwise the sides end up grouped on different
keys, or on a key set the
// child does not even have. Pick that member once, preferring the
finest when several
// qualify. Only the branch that shuffles a child reads these, hence
`lazy`.
+ // A child with a member built from a reduced scan only looks compatible
on the transform
+ // the scan still reports, so it is shuffled onto the best spec instead.
lazy val matchedIndexes = bestSpecOpt.toSeq.flatMap { best =>
- childrenIndexes.filter(i => best.isCompatibleWith(specs(i)))
+ childrenIndexes.filter(i => best.isCompatibleWith(specs(i)) &&
Review Comment:
Got it, thanks for the catch. Will open this PR today
--
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]