title: Save and Read Key-Value pair in Spark
body: <p>I have a JavaPairRDD in the following format:</p>
  
  <pre><code>JavaPairRDD&lt; String, Tuple2&lt; String, List&lt; String&gt;&gt;&gt; myData;
  </code></pre>
  
  <p>I want to save it as a Key-Value format <code>(String, Tuple2&lt; String, List&lt; String&gt;&gt;)</code>.</p>
  
  <pre><code>myData.saveAsXXXFile("output-path");
  </code></pre>
  
  <p>So my next job could read in the data directly to my <code>JavaPairRDD</code>:</p>
  
  <pre><code>JavaPairRDD&lt; String, Tuple2&lt; String, List&lt; String&gt;&gt;&gt; newData = context.XXXFile("output-path");
  </code></pre>
  
  <p>I am using Java 7, Spark 1.2, Java API. I tried <code>saveAsTextFile</code> and <code>saveAsObjectFile</code>, neither works. And I don't see <code>saveAsSequenceFile</code> option in my eclipse.</p>
  
  <p>Does anyone have any suggestion for this problem?
  Thank you very much!</p>