c21 commented on a change in pull request #35574:
URL: https://github.com/apache/spark/pull/35574#discussion_r813495175
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/physical/partitioning.scala
##########
@@ -322,8 +346,15 @@ case class RangePartitioning(ordering: Seq[SortOrder],
numPartitions: Int)
// `RangePartitioning(a, b, c)` satisfies `OrderedDistribution(a,
b)`.
val minSize = Seq(requiredOrdering.size, ordering.size).min
requiredOrdering.take(minSize) == ordering.take(minSize)
- case ClusteredDistribution(requiredClustering, _) =>
- ordering.map(_.child).forall(x =>
requiredClustering.exists(_.semanticEquals(x)))
+ case c @ ClusteredDistribution(requiredClustering, _,
requiredAllClusterKeys) =>
+ val expressions = ordering.map(_.child)
+ if (requiredAllClusterKeys) {
+ // Checks `RangePartitioning` is partitioned on exactly same
clustering keys of
+ // `ClusteredDistribution`.
Review comment:
Yes, it's less strict. Previously we don't allow `RangePartitioning` to
satisfy `HashClusteredDistribution`. I think it should be fine too.
--
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]