graphX​​不能绘制多重边线和顶点? [英] graphX cannot graph multiple Edges and Vertices?

查看:391
本文介绍了graphX​​不能绘制多重边线和顶点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的顶点的类型是:

org.apache.spark.rdd.RDD [((长,字符串),(长,字符串),(长,字符串))]

我的缘的类型是:

<$c$c>org.apache.spark.rdd.RDD[(org.apache.spark.graphx.Edge[String],org.apache.spark.graphx.Edge[String])]

当我试图图(顶点,边)。

When I tried to Graph(vertices, edges).

它说:

<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[?]]

(长字符串)是tuple2。

(Long String) is tuple2.

推荐答案

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

I think you have to correct both your vertex and edge rdd.

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

vertex rdd it is a rdd[(VertexId, vertexValueType)]

所以你要你的顶点RDD更改为:

so you have to change your vertex rdd to:

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

和边缘RDD它是一个RDD [边缘[edgeValueType]
所以实际上它应该是这样的:

and edge rdd it is a rdd[Edge[edgeValueType]] so indeed it should be like this:

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

也许你可以张贴code,你实际上是创造这个RDDS?

Maybe you can post a code where you actually create this rdds?

这篇关于graphX​​不能绘制多重边线和顶点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆