-2

my vertice type is:

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

my edge type is:

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

When I tried to Graph(vertices, edges).

It's saying:

<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) is tuple2.

eliasah
  • 39,588
  • 11
  • 124
  • 154
JY078
  • 393
  • 9
  • 21
  • 1
    What do you think you mean by ((Long, String), (Long,String), (Long,String))? Do you think you are declaring an `RDD` with three tuples as elements, or where each line in the `RDD` has 3 tuples? – David Griffin Apr 10 '16 at 11:07

1 Answers1

1

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

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

so you have to change your vertex rdd to:

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

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

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

Hlib
  • 2,944
  • 6
  • 29
  • 33