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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.2, 2.1.0
    • SQL
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: