Scala GraphLoader.edgeListFile(NumberFormatException)

时间:2018-05-09 01:18:50

标签: scala apache-spark

我从文件

中填充图表的边缘
val graph = GraphLoader.edgeListFile(sc, "comb.txt")

Hoverwe它的投掷错误。

java.lang.NumberFormatException: For input string: "116374117927631468606"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)

我认为它只接受整数节点值。我如何能 。解决这个问题

https://spark.apache.org/docs/1.4.0/api/java/org/apache/spark/graphx/GraphLoader.html

1 个答案:

答案 0 :(得分:0)

api文件清楚地说明了以下评论

  
    

/** * Loads a graph from an edge list formatted file where each line contains two integers: a source * id and a target id. Skips lines that begin with. * * If desired the edges can be automatically oriented in the positive * direction (source Id is less than target Id) by setting {canonicalOrientation {1}}

  

official site所说,to * true.值对于整数来说肯定很大

  
    

116374117927631468606