title: search rdd for value from another rdd
body: <p>I am using Spark + Scala. My rdd1 has customer info i.e. (<code>id</code>, <code>[name, address]</code>). rdd2 has only names of high profile customers. Now I want to find if customer in rdd1 is high profile or not. How can I search one rdd using another? Joining rdd's is not looking like a good solution for me.</p>
  
  <p>My code:</p>
  
  <pre><code>val result = rdd1.map( case (id, customer) =&gt; 
    customer.foreach ( c =&gt; 
      rdd2.filter(_ == c._1).count()!=0 ))
  </code></pre>
  
  <p><strong>Error</strong>:
  <code>org.apache.spark.SparkException: RDD transformations and actions can only be invoked by the driver, not inside of other transformations</code>;</p>