Serialization error in spark when converting List to rdds to get Correlations

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.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s