title: Saving RDD as sequence file in pyspark
body: <p>I am able to run this script to save the file in text format, but when I try to run saveAsSequenceFile it is erroring out. If any one have idea about how to save the RDD as sequence file, please let me know the process. I tried looking for solution in "Learning Spark" as well as official Spark documentation.</p>
  
  <p>This runs successfully</p>
  
  <pre><code>dataRDD = sc.textFile("/user/cloudera/sqoop_import/departments")
  dataRDD.saveAsTextFile("/user/cloudera/pyspark/departments")
  </code></pre>
  
  <p>This fails</p>
  
  <pre><code>dataRDD = sc.textFile("/user/cloudera/sqoop_import/departments")
  dataRDD.saveAsSequenceFile("/user/cloudera/pyspark/departmentsSeq")
  </code></pre>
  
  <blockquote>
    <p>Error: An error occurred while calling
    z:org.apache.spark.api.python.PythonRDD.saveAsSequenceFile. :
    org.apache.spark.SparkException: RDD element of type java.lang.String
    cannot be used</p>
  </blockquote>
  
  <p>Here is the data:</p>
  
  <pre><code>2,Fitness
  3,Footwear
  4,Apparel
  5,Golf
  6,Outdoors
  7,Fan Shop
  8,TESTING
  8000,TESTING
  </code></pre>