Approach to Import SparkSession in Scala
We can create SparkSession using spark-shell, Scala, Python. Spark-shell, provides the SparkSession by default and we can run SparkSession with variable spark. In Scala, the SparkSession is created with the following methods:
- builder() pattern method: Configures the SparkSession.
- master() method: Determines the master URL where the Spark Application is running.
- appName() method: Mentions the name of Spark Application.
- getOrCreat() method: Which takes the SparkSession already existing or it will create new SparkSession.
How to Import SparkSession in Scala?
This article focuses on discussing how to import SparkSession in Scala.
Table of Content
- What is Sparksession?
- Prerequisites
- Approach to Import SparkSession in Scala
- Implementation
- Create a DataFrame Using SparkSession
- Conclusion