dongjoon-hyun commented on a change in pull request #26631: [SPARK-29992][CORE] 
Change getActive access to public
URL: https://github.com/apache/spark/pull/26631#discussion_r349898568
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/SparkContext.scala
 ##########
 @@ -2590,7 +2590,7 @@ object SparkContext extends Logging {
   }
 
   /** Return the current active [[SparkContext]] if any. */
-  private[spark] def getActive: Option[SparkContext] = {
+  def getActive: Option[SparkContext] = {
 
 Review comment:
   Hi, @nishkamravi2 .
   Like the other review comments, I'm also wondering why you need this.
   I'd like to use the existing official API instead of making another public 
API.
   ```scala
   scala> org.apache.spark.sql.SparkSession.getActiveSession.get.sparkContext
   res7: org.apache.spark.SparkContext = org.apache.spark.SparkContext@298154d4
   ```
   
   We recommend users to use `SparkSession` instead of `SparkContext` if 
possible. And, we provide the API you need like the above.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to