pyspark.sql.SQLContext.getOrCreate#
- classmethod SQLContext.getOrCreate(sc=None)[source]#
Get the existing SQLContext or create a new one with given SparkContext.
When running in Spark Connect mode,
scis not required and the activeSparkSessionis used automatically.Added in version 1.6.0.
Deprecated since version 3.0.0: Use
SparkSession.builder.getOrCreate()instead.- Parameters:
- sc
SparkContext, optional Required in classic mode; ignored in Spark Connect mode.
- sc