Hi Team,
We have one csv file with no header and we want to include header how to do it. Could you please guide it for this.
i tried but it is throwing below error.
scala> case class Person(id:Int,name:String,age:Int,numfriends :Int)
defined class Person
scala> val ff = spark.read.format("csv").option("header","false").option("inferschema","true").load("spark/fakefriends.csv"). as [Person]
org.apache.spark.sql.AnalysisException: cannot resolve "`id`" given input columns: [_c0, _c1, _c2, _c3];