mercredi 27 mai 2015

Create JavaRDD from List without SparkContext

I am writing some JUnit unit tests around a spark project.

One of the functions that I am attempting to test accepts a JavaRDD as a parameter, and I would like to create that JavaRDD programmatically, and converting from a List to the RDD seems like the most logical approach.

How to convert List to JavaRDD suggests that I use JavaSparkContext.parallelize(List). However, seeing as I am doing this in a unit test, I do not want to instantiate a SparkContext object.

Aucun commentaire:

Enregistrer un commentaire