-
- Downloads
[SPARK-16372][MLLIB] Retag RDD to tallSkinnyQR of RowMatrix
## What changes were proposed in this pull request? The following Java code because of type erasing: ```Java JavaRDD<Vector> rows = jsc.parallelize(...); RowMatrix mat = new RowMatrix(rows.rdd()); QRDecomposition<RowMatrix, Matrix> result = mat.tallSkinnyQR(true); ``` We should use retag to restore the type to prevent the following exception: ```Java java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Lorg.apache.spark.mllib.linalg.Vector; ``` ## How was this patch tested? Java unit test Author: Xusen Yin <yinxusen@gmail.com> Closes #14051 from yinxusen/SPARK-16372.
Showing
- mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala 1 addition, 1 deletion...la/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala
- mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/RowMatrix.scala 1 addition, 1 deletion...org/apache/spark/mllib/linalg/distributed/RowMatrix.scala
- mllib/src/test/java/org/apache/spark/mllib/linalg/distributed/JavaRowMatrixSuite.java 44 additions, 0 deletions...he/spark/mllib/linalg/distributed/JavaRowMatrixSuite.java
Loading
Please register or sign in to comment