Create a DataFrame Using SparkSession
SparkSession has various methods like createDataFrame() used to create a DataFrame from list.
// Create DataFrame
val df = spark.createDataFrame(
List(("Prasad", 50), ("Santosh", 25), ("Sushma", 24)))
df.show()
Output:
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