I am new to Scala and having difficulty figuring out the issue with this code.
x.map{case (x1: Any, x2: Any,x3: String) => x1}.count()
Throwing
scala.MatchError: null error
this is the definition of x
scala> x.cache()
res111: x.type = MapPartitionsRDD[522] at map at <console>:49
scala> x
res109: org.apache.spark.rdd.RDD[(Any, Any, String)] = MapPartitionsRDD[522] at map at <console>:49
scala> x.count()
res112: Long = 64508825
Any pointers will be appreciated.
nullin your data. Why not justx.map(_._1).count? - philantrovertval x = sc.parallelize(Seq(("3", 1, "t"), (3.0, "1", "t"), null))which also gives the same error that the OP has encountered - Ramesh Maharjan