spark session code example
Example 1: making spark session
from pyspark.sql import SparkSession
spark = SparkSession \
.builder \
.appName("Python Spark SQL basic example") \
.config("spark.some.config.option", "some-value") \
.getOrCreate()
Example 2: To create a SparkSession
# To create a SparkSession
spark = SparkSession.builder.master(
"local").appName("Word Count").config(
"spark.some.config.option", "some-value").getOrCreate()