graphX 无法绘制多个边和顶点?

graphX cannot graph multiple Edges and Vertices?

我的顶点类型是:

org.apache.spark.rdd.RDD[((Long, String), (Long, String), (Long, String))]

我的边缘类型是:

org.apache.spark.rdd.RDD[(org.apache.spark.graphx.Edge[String],org.apache.spark.graphx.Edge[String])]

当我尝试绘制图形(顶点、边)时。

它说:

<console>:47: error: type mismatch;
 found   : org.apache.spark.rdd.RDD[((Long, String), (Long, String), (Long, String))]
 required: org.apache.spark.rdd.RDD[(org.apache.spark.graphx.VertexId, ?)]

<console>:47: error: type mismatch;
 found   : org.apache.spark.rdd.RDD[(org.apache.spark.graphx.Edge[String], org.apache.spark.graphx.Edge[String])]
 required: org.apache.spark.rdd.RDD[org.apache.spark.graphx.Edge[?]]

(Long String) 是 tuple2。

我认为你必须纠正你的顶点和边 rdd。

顶点rdd是一个rdd[(VertexId, vertexValueType)]

因此您必须将顶点 rdd 更改为:

org.apache.spark.rdd.RDD[(VertexId, ((Long, String), (Long, String), (Long, String)))]

and edge rdd是一个rdd[Edge[edgeValueType]] 所以确实应该是这样的:

org.apache.spark.rdd.RDD[org.apache.spark.graphx.Edge[String]]

也许您可以 post 实际创建此 rdds 的代码?