+1 vote
in Spark Sql by
How to convert RDD to DataFrame in Spark?

1 Answer

0 votes
by

case class Customers(custid: Int,cname: String,lname: String)

valpeopleDF = spark.sparkContext.textFile(“D:/Hadoop/Spark/SparkScala/customer_data.csv”)

.map(_.split(“,”))

.map(attribute => Customers(attribute(0).toInt,attribute(1),attribute(2)))

.toDF()

...