title: Spark Key/Value filter Function
body: <p>I have data in a Key Value pairing. I am trying to apply a filter function to the data that looks like:</p>
  
  <pre><code>  def filterNum(x: Int) : Boolean = {
      if (decimalArr.contains(x)) return true
      else return false
    }
  </code></pre>
  
  <p>My Spark code that has:</p>
  
  <pre><code>val numRDD = columnRDD.filter(x =&gt; filterNum(x(0)))
  </code></pre>
  
  <p>but that wont work and when I send in the:</p>
  
  <pre><code>val numRDD = columnRDD.filter(x =&gt; filterNum(x))
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>&lt;console&gt;:23: error: type mismatch;
   found   : (Int, String)
   required: Int
         val numRDD = columnRDD.filter(x =&gt; filterNum(x))
  </code></pre>
  
  <p>I also have tried to do other things like changing the inputs to the function</p>