1from pyspark.sql import SparkSession
2
3spark = SparkSession \
4 .builder \
5 .appName("Python Spark SQL basic example") \
6 .config("spark.some.config.option", "some-value") \
7 .getOrCreate()
1# To create a SparkSession
2
3spark = SparkSession.builder.master(
4 "local").appName("Word Count").config(
5 "spark.some.config.option", "some-value").getOrCreate()