Skip to content

Instantly share code, notes, and snippets.

import org.apache.spark._
import org.apache.spark.graphx._
val triplets = sc.textFile(path).flatMap { line =>
if (!line.isEmpty && line(0) != '#') {
val lineArray = line.split("\\s+")
if (lineArray.length < 2) {
None
} else {
val t = new EdgeTriplet[String, String]