Skip to content

Commit

Permalink
[SPARK-3650][GraphX] There will be an ArrayIndexOutOfBoundsException …
Browse files Browse the repository at this point in the history
…if the format of the source file is wrong

There will be an ArrayIndexOutOfBoundsException if the format of the source file is wrong
  • Loading branch information
Leolh committed Jan 23, 2015
1 parent ea74365 commit 23767f1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions graphx/src/main/scala/org/apache/spark/graphx/GraphLoader.scala
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,14 @@ object GraphLoader extends Logging {
val lineArray = line.split("\\s+")
if (lineArray.length < 2) {
logWarning("Invalid line: " + line)
}
val srcId = lineArray(0).toLong
val dstId = lineArray(1).toLong
if (canonicalOrientation && srcId > dstId) {
builder.add(dstId, srcId, 1)
} else {
builder.add(srcId, dstId, 1)
val srcId = lineArray(0).toLong
val dstId = lineArray(1).toLong
if (canonicalOrientation && srcId > dstId) {
builder.add(dstId, srcId, 1)
} else {
builder.add(srcId, dstId, 1)
}
}
}
}
Expand Down

0 comments on commit 23767f1

Please sign in to comment.