Github user viirya commented on the issue: https://github.com/apache/spark/pull/18697 A different view to this problem is, in the following part of query plan: :- *HashAggregate(keys=[parent#228], functions=[], output=[level1#270]) hashpartitioning(parent#228, 5) : +- Exchange hashpartitioning(parent#228, 5) hashpartitioning(parent#228, 5) : +- *HashAggregate(keys=[parent#228], functions=[], output=[parent#228]) UnknownPartitioning(0) : +- *Project [parent#228] UnknownPartitioning(0) At the top `HashAggregate`, when the output is going to alias the attribute `parent` to `level1`, the output partitioning `hashpartitioning(parent, 5)` doesn't change accordingly to `hashpartitioning(level1, 5)`. If we change `HashAggregate`'s output partitioning accordingly with its output, this query can return correct results. I think this is also an alternative solution. @aray What do you think?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org