From 1dd0fb572848c6d8d3f38579bf8f11ef993e6bf9 Mon Sep 17 00:00:00 2001 From: Naveen Kumar Puppala Date: Tue, 17 Mar 2026 16:24:29 -0700 Subject: [PATCH] [SPARK-55848][SQL][4.1] Restore deleted comments in satisfies0() Follow-up to #54751. Restores 3 comments that were accidentally deleted during the satisfies0() restructuring. --- .../spark/sql/catalyst/plans/physical/partitioning.scala | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/physical/partitioning.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/physical/partitioning.scala index fd71e22c555cd..8c9cc9144c991 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/physical/partitioning.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/physical/partitioning.scala @@ -392,11 +392,16 @@ case class KeyGroupedPartitioning( if (isPartiallyClustered) { false } else if (requireAllClusterKeys) { + // Checks whether this partitioning is partitioned on exactly same clustering keys of + // `ClusteredDistribution`. c.areAllClusterKeysMatched(expressions) } else { + // We'll need to find leaf attributes from the partition expressions first. val attributes = expressions.flatMap(_.collectLeaves()) if (SQLConf.get.v2BucketingAllowJoinKeysSubsetOfPartitionKeys) { + // check that join keys (required clustering keys) + // overlap with partition keys (KeyGroupedPartitioning attributes) requiredClustering.exists(x => attributes.exists(_.semanticEquals(x))) && expressions.forall(_.collectLeaves().size == 1) } else {