You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/08/26 19:14:27 UTC

[GitHub] [spark] mridulm commented on a diff in pull request #37661: [SPARK-40211][CORE][SQL] Allow customize initial partitions number in take() behavior

mridulm commented on code in PR #37661:
URL: https://github.com/apache/spark/pull/37661#discussion_r956363764


##########
core/src/main/scala/org/apache/spark/rdd/AsyncRDDActions.scala:
##########
@@ -84,18 +87,18 @@ class AsyncRDDActions[T: ClassTag](self: RDD[T]) extends Serializable with Loggi
       } else {
         // The number of partitions to try in this iteration. It is ok for this number to be
         // greater than totalParts because we actually cap it at totalParts in runJob.
-        var numPartsToTry = 1L
+        var numPartsToTry = Math.max(self.conf.get(RDD_LIMIT_INITIAL_NUM_PARTITIONS), 1)

Review Comment:
   Enforce it in Config itself and always use `self.conf.get(RDD_LIMIT_INITIAL_NUM_PARTITIONS)` ?
   
   For RDD_LIMIT_INITIAL_NUM_PARTITIONS:
   ```
   ...
   .intConf
   .checkValue(_ > 0, "")
   ...
   ```



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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