I'd recommend learning some Java in general before trying to work with a complex library like Spark. Person@3f03a49
is not a problem with casting, this is how an object of class Person
is converted to a String
by default. You just need to define
@Override
public String toString() {
return "Person(" + name + ")";
}
inside Person
class.
How do i get the stored data?
With any actions: first
, collect
, etc. But note that by default Spark doesn't store data, it's computed on the fly.