Creating a SparkSession
Let's start with creating a new SparkSession. In this course, you will be usually provided with one, but creating a new one or getting an existing one is a must-have skill!
Questo esercizio fa parte del corso
Introduction to PySpark
Istruzioni dell'esercizio
- Import
SparkSessionfrompyspark.sql. - Make a new
SparkSessioncalled"my_spark"usingSparkSession.builder.getOrCreate(). - Print
my_sparkto the console to verify it's aSparkSession.
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
# Import SparkSession from pyspark.sql
from ____ import ____
# Create my_spark
my_spark = SparkSession.builder.appName(____).____
# Print my_spark
____