Skip to content

Commit 0f66ec2

Browse files
committed
recognize object arrays
1 parent ad8c42f commit 0f66ec2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,10 @@ private[spark] object SerDe extends Serializable {
11131113
iter.flatMap { row =>
11141114
val obj = unpickle.loads(row)
11151115
if (batched) {
1116-
obj.asInstanceOf[JArrayList[_]].asScala
1116+
obj match {
1117+
case list: JArrayList[_] => list.asScala
1118+
case arr: Array[_] => arr
1119+
}
11171120
} else {
11181121
Seq(obj)
11191122
}

0 commit comments

Comments
 (0)