Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
val vs toIndexedSeq
  • Loading branch information
bjornjorgensen committed Jan 15, 2025
commit b9c917f1b83be9df05afb3a6db0fb352640582ff
2 changes: 1 addition & 1 deletion src/main/scala/org/graphframes/examples/Graphs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class Graphs private[graphframes] () {
(fields(0).toLong * 2, fields(1).toLong * 2 + 1, fields(2).toDouble)
}
val edges = spark.createDataFrame(data).toDF("src", "dst", "weight")
val vs = data.flatMap(r => r._1 :: r._2 :: Nil).collect().distinct.map(x => Tuple1(x))
val vs = data.flatMap(r => r._1 :: r._2 :: Nil).collect().distinct.map(x => Tuple1(x)).toIndexedSeq
val vertices = spark.createDataFrame(vs).toDF("id")
GraphFrame(vertices, edges)
}
Expand Down