I have this case class like this:
case class Data(a: String, b: String, c: String);
and this dataset like this:
val dataset: Dataset<SomeDataset>;
and function inside companion object (to prevent task not serializable exception)
object MyObj {
def doSomething(value: SomeDataset, data: Data //instance of case class) {...}
}
I would like to do something like this:
val data = Data(...) //instance of case class
dataset.map { doSomething(_, data) }
After this I am getting Task not serializable exception from spark. If i remove second argument from doSomething function it works find.
I tried even to make Data case class extends Serializable interface and it still does not work. Like this:
case class Data(a: String, b: String, c: String) extends Serializable
How do i make this working?