spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [spark] cloud-fan commented on a change in pull request #26516: [SPARK-29893] improve the local shuffle reader performance by changing the reading task number from 1 to multi.
Date Tue, 19 Nov 2019 07:50:19 GMT
cloud-fan commented on a change in pull request #26516: [SPARK-29893] improve the local shuffle
reader performance by changing the reading task number from 1 to multi.
URL: https://github.com/apache/spark/pull/26516#discussion_r347771296
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/LocalShuffledRowRDD.scala
 ##########
 @@ -52,19 +56,42 @@ private final class LocalShuffledRowRDDPartition(
  */
 class LocalShuffledRowRDD(
      var dependency: ShuffleDependency[Int, InternalRow, InternalRow],
-     metrics: Map[String, SQLMetric])
+     metrics: Map[String, SQLMetric],
+     advisoryParallelism : Option[Int] = None)
   extends RDD[InternalRow](dependency.rdd.context, Nil) {
 
   private[this] val numReducers = dependency.partitioner.numPartitions
   private[this] val numMappers = dependency.rdd.partitions.length
 
   override def getDependencies: Seq[Dependency[_]] = List(dependency)
 
-  override def getPartitions: Array[Partition] = {
+  /**
+   * To equally divide n elements into m buckets, basically each bucket should have n/m elements,
+   * for the remaining n%m elements, add one more element to the first n%m buckets each.
Returns
+   * a sequence with length numBuckets and each value represents the start index of each
bucket.
+   */
+  def equallyDivide(numElements: Int, numBuckets: Int): Seq[Int] = {
 
 Review comment:
   nit: `private`

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message