in Spark Sql by
Q:
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()

Click here to read more about Loan/Mortgage
Click here to read more about Insurance

Related questions

0 votes
asked Mar 7, 2020 in Spark Sql by rahuljain1
+1 vote
asked Mar 9, 2020 in Spark Sql by SakshiSharma
0 votes
asked Mar 7, 2020 in Spark Sql by rahuljain1
+1 vote
asked Mar 9, 2020 in Spark Sql by SakshiSharma
+1 vote
asked Jun 30, 2019 in Spark Sql by anonymous
...