I try to call a method on a value. But get an error. My method.
processDate(p(2))
The values look somewhat like 20160125204123
This is my class.
class ScalaJob(sc: SparkContext) {
def run(filePath: String) : RDD[(String, String, String)] = {
//pass the file
val file = sc.textFile(filePath);
//find values in every raw
val values = file.map{
dataRaw =>
val p = dataRaw.split("[|]",-1)
(p(1), processDate(p(2)), p(32))
}
My method should return a string
def processDate(s: String) : String = {
Is there a way to make it work?