I am facing following issue while read CSV file using Intellij Scala.
Error Message:
Exception in thread "main" java.lang.NoSuchMethodError: scala.collection.mutable.Buffer$.empty()Lscala/collection/GenTraversable;
at org.apache.spark.sql.SparkSessionExtensions.<init>(SparkSessionExtensions.scala:72)
at org.apache.spark.sql.SparkSession$Builder.<init>(SparkSession.scala:780)
at org.apache.spark.sql.SparkSession$.builder
Source Code:
import org.apache.spark.sql.SparkSession
object broadcastright {
def main(args : Array[String]): Unit = {
val spark = SparkSession
.builder()
.master("local")
.appName("Read CSV File")
.getOrCreate()
val df = spark.read
.option("header", "true")
.option("delimiter", ",")
.option("inferSchema", "false")
.load("src\\main\\resources\\people.csv")
df.show()
}
}
Pom.xml
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.12</artifactId>
<version>2.4.5</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.12</artifactId>
<version>2.4.0</version>
</dependency>
I am not sure what is the cause for this issue.




