cloud-fan commented on a change in pull request #31355:
URL: https://github.com/apache/spark/pull/31355#discussion_r565381214



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/connector/distributions/distributions.scala
##########
@@ -29,31 +29,47 @@ private[sql] object LogicalDistributions {
     ClusteredDistributionImpl(clustering)
   }
 
+  def clustered(clustering: Array[Expression], numPartitions: Int): 
ClusteredDistribution = {
+    ClusteredDistributionImpl(clustering, Some(numPartitions))
+  }
+
   def ordered(ordering: Array[SortOrder]): OrderedDistribution = {
     OrderedDistributionImpl(ordering)
   }
+
+  def ordered(ordering: Array[SortOrder], numPartitions: Int): 
OrderedDistribution = {
+    OrderedDistributionImpl(ordering, Some(numPartitions))
+  }
 }
 
 private[sql] object UnspecifiedDistributionImpl extends 
UnspecifiedDistribution {
   override def toString: String = "UnspecifiedDistribution"
 }
 
 private[sql] final case class ClusteredDistributionImpl(
-    clusteringExprs: Seq[Expression]) extends ClusteredDistribution {
+    clusteringExprs: Seq[Expression],
+    numPartitions: Option[Int] = None) extends ClusteredDistribution {

Review comment:
       why this needs to be optional while we define non-negative value as no 
requirement?




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

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