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

task not serializable with groupByKey() + mapGroups() + map

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.2, 2.1.0
    • Component/s: SQL
    • Labels:
      None

      Description

      just run the following code

      val a = spark.createDataFrame(sc.parallelize(Seq((1,2),(3,4)))).as[(Int,Int)]
      val grouped = a.groupByKey({x:(Int,Int)=>x._1})
      val mappedGroups = grouped.mapGroups((k,x)=>{(k,1)})
      val yyy = sc.broadcast(1)
      val last = mappedGroups.rdd.map(xx=>{
        val simpley = yyy.value
        
        1
      })
      
      

      spark says Task not serializable

        Attachments

          Activity

            People

            • Assignee:
              eseyfe Ergin Seyfe
              Reporter:
              yangyangyyy Yang Yang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: