score:0

with your current implementation, you can just replace matrixentry and add .collect.toseq at the end of the process, like:

val value:rdd[string] = sc.textfile("file:///usr/local/data.csv")
val data: seq[string] = 
      sc.parallelize(value).map {
            line => {
                  val fields = line.split(":")
                  val i = fields(0).tolong
                  val j = fields(1).tolong
                  val r = fields(2).todouble
                  "%d,%d,%f".format(i, j, r)
            }
      }.collect().toseq

Related Query

More Query from same tag