title: Spark : RDD action to be triggerd for DStream to be processed
body: <p>As per the spark documention as per the link here </p>
  
  <p><a href="http://spark.apache.org/docs/latest/streaming-programming-guide.html#other-points-to-remember" rel="nofollow noreferrer">http://spark.apache.org/docs/latest/streaming-programming-guide.html#other-points-to-remember</a></p>
  
  <p>"DStreams are executed lazily by the output operations, just like RDDs are lazily executed by RDD actions. Specifically, RDD actions inside the DStream output operations force the processing of the received data. Hence, if your application does not have any output operation, or has output operations like dstream.foreachRDD() without any RDD action inside them, then nothing will get executed. The system will simply receive the data and discard it."</p>
  
  <p>We have a spark streaming application with map operation followed by the DStream output operation As pert the documentation we have a RDD action inside <strong>foreachRDD</strong> which is <strong>rdd.first()</strong> but still nothing happen's </p>
  
  <pre><code>tempRequestsWithState is DStream 
  
  tempRequestsWithState.foreachRDD { rdd =&gt;
      rdd.first()
  
    }
  </code></pre>
  
  <p>but interestingly if we do <strong>rdd.foreach</strong> inside foreachRDD application run's perfectly ....</p>
  
  <pre><code>tempRequestsWithState.foreachRDD { rdd =&gt;
      rdd.foreach {
  
      }
    }
  </code></pre>
  
  <p><strong>In our case rdd.foreach  is a very slow operation and would like to avoid it as we are dealing with huge data load of 10,000 events/sec also we need the foreachRDD ..</strong> </p>
  
  <p>Please let us know if we are missing anything and if we can try any other RDD action inside foreachRDD </p>