LuciferYang commented on code in PR #47349:
URL: https://github.com/apache/spark/pull/47349#discussion_r1677336255


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:
##########
@@ -641,14 +641,19 @@ object SQLConf {
     .checkValue(_ > 0, "The value of spark.sql.leafNodeDefaultParallelism must 
be positive.")
     .createOptional
 
+  // Lazily get the number of cores to make sure SparkContext created first.
+  private lazy val defaultShufflePartition: Option[Int] = 
SparkContext.getActive.flatMap { sc =>
+    if (sc.master.startsWith("local")) 
Some(SparkContext.numDriverCores(sc.master)) else None

Review Comment:
   This looks like it will break the `local-cluster` mode. With this change, 
`SHUFFLE_PARTITIONS` seems to be configured to 0 in `local-cluster` mode?



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