-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example from “Adv. Analytics with Spark”, Chapter 9 fails #64
Comments
More detail: |
Thanks for the detail. I suspect I can find a way to edit the code to avoid whatever causes this in all cases. |
How are you running this -- in the shell? I don't see here how it would become part of something that's serialized. |
Yes, I am running it in the shell. then MonteCarloSource contains code from Chapter 9. |
Can you share this source file so I see exactly what you're running? |
MonteCarloSource.scala // source file |
@sryza can I ask you to look at this? I can't find the crude oil TSV data for example, in order to reproduce this from the source code above. It shouldn't be a problem, but in the shell, something's causing the model objects to get into a closure even though it's not used with Spark. As a guess at a workaround, you might avoid making the
to
Shouldn't be necessary but we're trying to avoid issues with the closure that are specific to the shell. |
Tried above, fails with: |
Oh, I think you copied and pasted it literally with the line break. It needs to be one command. It's just trying to avoid the |
It is all in one line: |
Hm, that does mean "toArray" has been entered as a statement by itself. Are you certain? The statement here should not be able to generate that error. |
That code should be valid and equivalent to the existing code. Right? Something else funny must be going on in how it is being entered in the shell. |
I don't know how to proceed on this one except to make the change I suggested above. It can't hurt, at least. Will do that. At least it would give you an unambiguously working piece of code to compare against. |
…th text. And updates Spark to 1.6.1 and updates some plugins
Hello Everyone, Does this book have Python version of code? If yes please help me to get the copies of those. Thanks & Best Regards |
Hi @mukesh-ranjan, The book only has Scala versions of the code. -Sandy |
Hi @srowen, You are right,it's models referencence. Thank you |
( Running the trials part )
val trials = seedRdd.flatMap(trialReturns(_, numTrials / parallelism, bFactorWeights.value, factorMeans, factorCov))
org.apache.spark.SparkException: Task not serializable
The text was updated successfully, but these errors were encountered: