@Sudharsan
Ganeshkumar
AFAIK the csv format is not compatible between spark sql and hive serde and hence the error you are getting. A solution to this problem would be to:
1. create an external table pointing to the path where you will save the csv file
2. save the csv file instead of using saveAsTable function
spark.sql("CREATE EXTERNAL TABLE Student_Spark2(col1 int,col2 string) STORED AS TEXTFILE LOCATION '/path/in/hdfs'")
//later save
rddstudent.write.format("csv").save("/path/in/hdfs/student_spark2")
HTH
*** If you found this answer addressed your question, please take a moment to login and click the "accept" link on the answer.