Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-1857

map() with lookup() causes exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 0.9.0
    • None
    • None
    • None

    Description

      Using map() and lookup() in conjunction throws an exception

      val a = sc.parallelize(Array(11))
      val m = sc.parallelize(Array((11,21)))
      a.map(m.lookup(_)(0)).collect
      
      14/05/14 15:03:35 ERROR Executor: Exception in task ID 23
      scala.MatchError: null
      at org.apache.spark.rdd.PairRDDFunctions.lookup(PairRDDFunctions.scala:551)
      

      A workaround is:

      a.map((_,0)).join(m).map(_._2._2).collect
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            michaelmalak Michael Malak
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: