title: scala.MatchError: null error
body: <p>I am new to Scala and having difficulty figuring out the issue with this code.</p>
  
  <pre><code>x.map{case (x1: Any, x2: Any,x3: String) =&gt; x1}.count()
  </code></pre>
  
  <p>Throwing </p>
  
  <pre><code>scala.MatchError: null error
  </code></pre>
  
  <p>this is the definition of <code>x</code></p>
  
  <pre><code>scala&gt; x.cache()
  res111: x.type = MapPartitionsRDD[522] at map at &lt;console&gt;:49
  
  scala&gt; x
  res109: org.apache.spark.rdd.RDD[(Any, Any, String)] = MapPartitionsRDD[522] at map at &lt;console&gt;:49
  
  scala&gt; x.count()
  res112: Long = 64508825
  </code></pre>
  
  <p>Any pointers will be appreciated.</p>