pyspark.SparkContext.getOrCreate

classmethod SparkContext.getOrCreate(conf: Optional[pyspark.conf.SparkConf] = None) → pyspark.context.SparkContext[source]

Get or instantiate a SparkContext and register it as a singleton object.

Parameters
confpyspark.SparkConf, optional