viirya commented on code in PR #42324:
URL: https://github.com/apache/spark/pull/42324#discussion_r1285448439


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/physical/partitioning.scala:
##########
@@ -355,6 +355,13 @@ case class KeyGroupedPartitioning(
 
   override def createShuffleSpec(distribution: ClusteredDistribution): 
ShuffleSpec =
     KeyGroupedShuffleSpec(this, distribution)
+
+  def uniquePartitionValues: Seq[InternalRow] = {
+    partitionValues
+        .map(InternalRowComparableWrapper(_, expressions))
+        .distinct
+        .map(_.row)
+  }

Review Comment:
   Hmm, one question. Based on `KeyGroupedPartitioning` document, 
`partitionValues` must be unique? This issue is caused by duplicated partition 
values? Is the document wrong? 



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/physical/partitioning.scala:
##########
@@ -355,6 +355,13 @@ case class KeyGroupedPartitioning(
 
   override def createShuffleSpec(distribution: ClusteredDistribution): 
ShuffleSpec =
     KeyGroupedShuffleSpec(this, distribution)
+
+  def uniquePartitionValues: Seq[InternalRow] = {
+    partitionValues
+        .map(InternalRowComparableWrapper(_, expressions))
+        .distinct
+        .map(_.row)
+  }

Review Comment:
   Hmm, one question. Based on `KeyGroupedPartitioning` document, 
`partitionValues` must be unique. This issue is caused by duplicated partition 
values? Is the document wrong? 



-- 
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]

Reply via email to