+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()

Related questions

0 votes
asked Mar 7, 2020 in Spark Sql by rahuljain1
0 votes
asked Feb 12, 2023 in Spark Sql by sharadyadav1986
...