You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by zhangjp <59...@qq.com> on 2016/01/25 03:44:25 UTC

how to save Matrix type result to hdfs file using java

Hi all,
     I have calculated a  covariance, it's a Matrix type ,now i want to save the result to hdfs, how  can i do it?  
    thx

回复: how to save Matrix type result to hdfs file using java

Posted by zhangjp <59...@qq.com>.
Hi  Yanbo,
      I'm using java language and the environment is spark 1.4.1.  
  
      Can u tell me how to do it more detail , the follows is my code, how can i save the cov to hdfs file ?
 "
     RowMatrix mat = new RowMatrix(rows.rdd());
      Matrix cov = mat.computeCovariance();   "
       The cov is  localMatrix, if the Matrix is much more than 5G , is there any better way to do it.
  
        THX.
 
 
 ------------------ 原始邮件 ------------------
  发件人: "Yanbo Liang";<yb...@gmail.com>;
 发送时间: 2016年1月25日(星期一) 中午1:31
 收件人: "zhangjp"<59...@qq.com>; 
 抄送: "user"<us...@spark.apache.org>; 
 主题: Re: how to save Matrix type result to hdfs file using java

 

 Matrix can be save as column of type MatrixUDT.

Re: how to save Matrix type result to hdfs file using java

Posted by Yanbo Liang <yb...@gmail.com>.
Matrix can be save as column of type MatrixUDT.