I am trying to make sense of the following code snippet. I think this more of a Scala than a Spark question...
val links = sc.textFile("../../data/links.csv")
val linksRDD: RDD[Edge[Connexion]] = links map {line =>
val row = line split ','
Edge(row(0).toInt, row(1).toInt, row(2))
}
I am used to seeing the following type of idiom in regards to calling the Spark map() function on an RDD:
links.map{line => val fields = line.split(","); val f1 = x._1; (f1, "stuff)}
My question is: that I cannot understand the construct:
val row = line split ','
All the (very limited) Spark examples that I so far see following the pattern:
val row = line.split(',')
I feel as though in rushing through my basic Spark tutorials in order to get to Scala, that I have missed something rather basic.
Can somebody please tell me what I have missed...?
Thanks