You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Bin WU <bw...@connect.ust.hk> on 2014/07/01 10:49:59 UTC

Question about VD and ED

Hi all,


I am a newbie to graphx.


I am currently having troubles understanding the types "VD" and "ED". I notice that "VD" and "ED" are widely used in graphx implementation, but I don't know why and how I am supposed to use them.


Specifically, say I have constructed a graph "graph : Graph[String, Double]", when, why, and how should I transform it into the type Graph[VD, ED]?


Also, I don't know what package should I import. I have imported:


"

import org.apache.spark.graphx._
import org.apache.spark.rdd.RDD"

But the two types "VD" and "ED" are still not found.


Sorry for the stupid question.


Thanks in advance!


Best,

Ben

Re: Question about VD and ED

Posted by "Baoxu Shi(Dash)" <bs...@nd.edu>.
Hi Bin,

VD and ED are ClassTags, you could treat them as placeholder, or template T in C (not 100% clear).

You do not need convert graph[String, Double] to Graph[VD,ED].

Check ClassTag’s definition in Scala could help.

Best,

On Jul 1, 2014, at 4:49 AM, Bin WU <bw...@connect.ust.hk> wrote:

> Hi all,
> 
> I am a newbie to graphx.
> 
> I am currently having troubles understanding the types "VD" and "ED". I notice that "VD" and "ED" are widely used in graphx implementation, but I don't know why and how I am supposed to use them.
> 
> Specifically, say I have constructed a graph "graph : Graph[String, Double]", when, why, and how should I transform it into the type Graph[VD, ED]?
> 
> Also, I don't know what package should I import. I have imported:
> 
> "
> import org.apache.spark.graphx._
> import org.apache.spark.rdd.RDD"
> 
> But the two types "VD" and "ED" are still not found.
> 
> Sorry for the stupid question.
> 
> Thanks in advance!
> 
> Best,
> Ben