I am trying to save as textfile using saveAsNewAPIHadoopfile() method. But I am getting error as follows.
RDD element of type java.lang.String cannot be used
I have imported departments table from mysql and have stored in hdfs. I am using below syntax for reading and storing in hdfs by python in spark.I am not able to figure out the error. Your help will be appreciated.
dept = sc.textFile("/user/cloudera/sqoop_import/departments")
Note: I have already used saveAsTetFile() without any error.