sunchao commented on a change in pull request #35657:
URL: https://github.com/apache/spark/pull/35657#discussion_r840821838
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/EnsureRequirements.scala
##########
@@ -177,6 +186,26 @@ case class EnsureRequirements(
children
}
+ private def checkKeyGroupedSpec(shuffleSpec: ShuffleSpec): Boolean = {
+ def check(spec: KeyGroupedShuffleSpec): Boolean = {
+ val attributes = spec.partitioning.expressions.flatMap(_.collectLeaves())
+ val clustering = spec.distribution.clustering
+
+ if
(SQLConf.get.getConf(SQLConf.REQUIRE_ALL_CLUSTER_KEYS_FOR_CO_PARTITION)) {
+ attributes.length == clustering.length &&
attributes.zip(clustering).forall {
+ case (l, r) => l.semanticEquals(r)
+ }
+ } else {
+ true // already validated in `KeyGroupedPartitioning.satisfies`
Review comment:
That is for `spark.sql.requireAllClusterKeysForDistribution` (e.g.,
aggregate, window), while this is for
`spark.sql.requireAllClusterKeysForCoPartition`. I know it's confusing ...
--
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]