I have a JavaRDD object and want to create another new JavaRDD object by selecting a substring of the original one. How to achieve that?
// Read input_train data
logger.info("start to read file");
JavaRDD<String> inputDataRaw= sc.textFile(input_train);
There inputDataRaw.first() is something like: "apple1; apple2;" (say String s1)
I want to JavaRDD with each line consisting of "apple1" only, i.e.,:
String s2 = s1.substring(0, 6)