Github user yhuai commented on the pull request: https://github.com/apache/spark/pull/5208#issuecomment-91339237 Actually, instead of introducing new `Distribution` and `Partitioning`, how about we add the following two concepts to a `SparkPlan`. * `requiredPartitionOrdering: Seq[Seq[SortOrder]]` defines the required ordering of rows in a partition for the children of a `SparkPlan`. For every child, `Seq[SortOrder]` defines the required ordering of rows generated by this child. * `outputPartitionOrdering: Seq[SortOrder]` defines the ordering of rows generated by a `SparkPlan`. With these concepts, we can mix the requirements on the data distribution in a partition with our existing requirements on the data distribution of the entire dataset. For example, for `SortMergeJoin`, we need `ClusteredDistribution` (or `OrderedDistribution`) and a non-empty list of columns for `RequiredPartitionOrdering`s of its children.
--- 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