title: Initialize an RDD to empty
body: <p>I have an RDD called</p>
  
  <pre><code>JavaPairRDD&lt;String, List&lt;String&gt;&gt; existingRDD; 
  </code></pre>
  
  <p>Now I need to initialize this  <code>existingRDD</code> to empty so that when I get the actual rdd's I can do a union with this <code>existingRDD</code>.
  How do I initialize <code>existingRDD</code> to an empty RDD except initializing it to null?
  Here is my code:</p>
  
  <pre><code>JavaPairRDD&lt;String, List&lt;String&gt;&gt; existingRDD;
  if(ai.get()%10==0)
  {
      existingRDD.saveAsNewAPIHadoopFile("s3://manthan-impala-test/kinesis-dump/" + startTime + "/" + k + "/" + System.currentTimeMillis() + "/",
      NullWritable.class, Text.class, TextOutputFormat.class); //on worker failure this will get overwritten                                  
  }
  else
  {
      existingRDD.union(rdd);
  }
  </code></pre>