Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3884#discussion_r23343271
  
    --- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala ---
    @@ -1466,17 +1531,29 @@ class SparkContext(config: SparkConf) extends 
Logging with ExecutorAllocationCli
         }
       }
     
    -  def getCheckpointDir = checkpointDir
    +  def getCheckpointDir = {
    +    assertNotStopped()
    +    checkpointDir
    +  }
     
       /** Default level of parallelism to use when not given by user (e.g. 
parallelize and makeRDD). */
    -  def defaultParallelism: Int = taskScheduler.defaultParallelism
    +  def defaultParallelism: Int = {
    --- End diff --
    
    This throws an exception because `taskScheduler` is null:
    
    ```
    scala> sc.defaultParallelism
    java.lang.NullPointerException
        at 
org.apache.spark.SparkContext.defaultParallelism(SparkContext.scala:1461)
        at $iwC$$iwC$$iwC$$iwC.<init>(<console>:13)
        at $iwC$$iwC$$iwC.<init>(<console>:18)
        at $iwC$$iwC.<init>(<console>:20)
        at $iwC.<init>(<console>:22)
        at <init>(<console>:24)
        at .<init>(<console>:28)
        at .<clinit>(<console>)
        at .<init>(<console>:7)
        at .<clinit>(<console>)
        at $print(<console>)
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to