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

map() with lookup() causes exception

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 0.9.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: