GitHub user yinxusen opened a pull request:

    https://github.com/apache/spark/pull/14051

    [SPARK-16372][MLlib] RowMatrix constructor should use retag for Java 
compatibility

    ## 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
    
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/yinxusen/spark SPARK-16372

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/14051.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #14051
    
----
commit 82b4edd374cd5cd0f4f7c87e8d2e5ec7d3fbf3f1
Author: Xusen Yin <yinxu...@gmail.com>
Date:   2016-07-05T00:03:44Z

    add retag

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to