Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.ClassCastException on shortestPaths calculation #253

Open
cj2001 opened this issue Jan 15, 2018 · 4 comments
Open

java.lang.ClassCastException on shortestPaths calculation #253

cj2001 opened this issue Jan 15, 2018 · 4 comments

Comments

@cj2001
Copy link

cj2001 commented Jan 15, 2018

I have a graph, g, which is roughly 4.5M vertices and 43M edges as:

scala> g res10: org.graphframes.GraphFrame = GraphFrame(v:[id: int], e:[src: int, dst: int])

I would like to calculate the shortest path between two given vertices, so I have run

val shortest_path = g.shortestPaths.landmarks(Seq("1","2")).run().

based on the documentation provided here. While this runs and generates the shortest_path dataframe, when I try to .show() that dataframe I get:

java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer.

Suggestions?

@felixcheung
Copy link
Member

felixcheung commented Jan 16, 2018

It's been a while but I recall some issue with shortestpaths - it looked like scala unbox error like this

java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
at scala.runtime.BoxesRunTime.unboxToInt(BoxesRunTime.java:106)

(would be good if anyone would like to help fix)

I was able to workaround with id etc casted to string

v1 = v.select(v.id.cast("string").alias("id"))
e1 = e.select(e.src.cast("string").alias("src"), e.dst.cast("string").alias("dst"), e.relationship)
g1 = GraphFrame(v1, e1)

@cj2001
Copy link
Author

cj2001 commented Jan 16, 2018

This appears to have worked. Thank you! (I leave it up to you whether you want to keep this issue open as a reminder to look into that error or not.)

@felixcheung
Copy link
Member

let's see if we can fix this...

@marty90
Copy link

marty90 commented Dec 12, 2019

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants