Skip to content

Exception in thread "main" org.apache.spark.SparkException: Task not serializable #627

@hyunjun

Description

@hyunjun

Hi, I could run the example like below;

val m1 = Map(...)
val m2 = Map(...)
spark.makeRDD(Seq(m1, m2)).saveToEs(...)

However, I couldn't convert my method to Seq

def myMethod(s: String): Map[String, String] = { ... }

def main(args: Array[String]) {
  ...
  val mine = prev.map(myMethod) // I'd like to put this result into makeRDD
  spark.makeRDD(???).saveToEs(...)
}

I did various ways, just got several errors including Task not serializable
Let me know, please. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions