[SPARK-5380][GraphX] Solve an ArrayIndexOutOfBoundsException when build graph with a file format error

When I build a graph with a file format error, there will be an ArrayIndexOutOfBoundsException

Author: Leolh <leosandylh@gmail.com>

Closes #4176 from Leolh/patch-1 and squashes the following commits:

94f6d22 [Leolh] Update GraphLoader.scala
23767f1 [Leolh] [SPARK-3650][GraphX] There will be an ArrayIndexOutOfBoundsException if the format of the source file is wrong
This commit is contained in:
Leolh 2015-02-06 09:01:53 +00:00 коммит произвёл Sean Owen
Родитель dc0c4490a1
Коммит 575d2df350
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -77,7 +77,7 @@ object GraphLoader extends Logging {
if (!line.isEmpty && line(0) != '#') {
val lineArray = line.split("\\s+")
if (lineArray.length < 2) {
logWarning("Invalid line: " + line)
throw new IllegalArgumentException("Invalid line: " + line)
}
val srcId = lineArray(0).toLong
val dstId = lineArray(1).toLong