0
數組我有對象的這樣對於GraphX我如何對象的數組轉換爲邊
edges: Array[Array[(Long, Long, String)]] = Array(Array((-209215114,197853780,Investor), (-209215114,-322475625,Investor), ...
一個數組,我想將其轉換爲邊的一個數組來傳遞給圖形生成器。這裏是我使用的是什麼:
val eRDD: RDD[Edge[(VertexId, VertexId, String)]] = edges.map(x => Edge(x(0), x(1), x(2)))
我收到以下錯誤:
<console>:107: error: type mismatch;
found : (Long, Long, String)
required: org.apache.spark.graphx.VertexId
(which expands to) Long
val eRDD: RDD[Edge[(VertexId, VertexId, String)]] = edges.map(x => Edge(x(0), x(1), x(2)))
優秀的大衛,謝謝 –