Skip to content

Instantly share code, notes, and snippets.

@bveliqi
Last active October 29, 2017 22:55
Show Gist options
  • Save bveliqi/3a943c5b7628ca537901f4c82b0a4997 to your computer and use it in GitHub Desktop.
Save bveliqi/3a943c5b7628ca537901f4c82b0a4997 to your computer and use it in GitHub Desktop.
val vertices = idTable.select("id", "screenName")
.distinct()
val edges = idTable.selectExpr("id as src", "friend_id as dst")
.where('dst.isNotNull)
.withColumn("relationship", lit("follower"))
val graph = GraphFrame(vertices, edges)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment