Skip to content
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

Fold() and Reduce() are not found at runtime #1

Open
Kognefaure opened this issue Apr 14, 2015 · 1 comment
Open

Fold() and Reduce() are not found at runtime #1

Kognefaure opened this issue Apr 14, 2015 · 1 comment
Labels

Comments

@Kognefaure
Copy link
Collaborator

Hello team!

I just pushed a class ArticleProcessorTest that contains a main() function where I test the ArticleProcessor class using dummy articles.
When running this test, the program crashes when it reaches this line (ArticleProcessor.java:44):

final Tuple2<String, Integer> totalAmount = wordCountRddReduced.fold(...)

The exception thrown is NoSuchMethod, pointing to the function fold.

So the spark running environment cannot recognize the signature of the fold() function I'm using, even though it builds properly inside Eclipse. This could be due to mismatching library versions. However I tried these different ways:

  • compiling with Maven, and running on my local spark installation (spark 1.2.1, scala 2.10.4)
  • compiling with Maven, and running on HDFS (don't know the config)
  • compiling and running with my local spark installation.

Because of this last configuration, I really can't understand why this happens, since it should be the exact same setup both for building and executing.

I tried to replace the fold() with a reduce(), but the same thing happens. The other RDD functions I'm using work fine (even reduceByKey()...)

Has anyone an idea for a fix? I would be grateful if someone could try and run this test as well. The command is (use "local[2]" instead of "yarn-client" if you use your local spark installation):

spark-submit --master yarn-client --class exec.ArticleProcessorTest [Path/to/Your/Jar].jar

@Kognefaure Kognefaure added the bug label Apr 14, 2015
@Kognefaure
Copy link
Collaborator Author

Just pushed an ugly fix. I replaced the fold() call by a collect(); this effectively de-parallelizes the RDD, turning it into a normal java list, so it will be inefficient. But it works. So let's keep this version for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant