Convert JavaPairRDD to JavaRDD Convert JavaPairRDD to JavaRDD elasticsearch elasticsearch

Convert JavaPairRDD to JavaRDD


What data do you have in the JavaPairRDD columns? A JavaPairRDD is a key/value mapping between the first and second column, unlike a normal RDD.

You possibly want to drop off the first column from the JavaPairRDD, returning just JavaRDD with just the value column.

To to this, simply run something like:

JavaRDD newRDD = esRDD.map(x => x._2);

or equivalent to create a new JavaRDD without the first column.