At 2014-10-13 21:08:15 -0400, Soumitra Johri <soumitra.siddha...@gmail.com> 
wrote:
> There is no 'long' field in my file. So when I form the edge I get a type
> mismatch error. Is it mandatory for GraphX that every vertex should have a
> distinct id. ?
>
> in my case n1,n2,n3,n4 are all strings.

(+user so others can see the solution)

Yes, GraphX currently only supports integer vertex ids. If your data is stored 
with string ids, a possible workaround is to hash them to integers using 
String.hashCode. If you need access to the string representation later, you can 
store it in the vertex attribute.

I added a file to the Gist that does this: 
https://gist.github.com/ankurdave/587eac4d08655d0eebf9#file-load-edges-with-properties-and-string-id-scala

Ankur

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org

Reply via email to