Today I went into a problem —
I was trying to use the mllib’s correlation function in spark.
I got 2 lists. I need to convert them to rdds first which is easy through sc.parrellelizeDoubles() method.
However it shows — class not serializable!
The reason is becasue the sc is final. And finals cannot be serialized.
In the end I solved this by creating my own method for pearson’s correlation.