Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14049#discussion_r69520353
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/RowMatrix.scala 
---
    @@ -538,20 +538,29 @@ class RowMatrix @Since("1.0.0") (
         val col = numCols().toInt
         // split rows horizontally into smaller matrices, and compute QR for 
each of them
         val blockQRs = rows.glom().map { partRows =>
    -      val bdm = BDM.zeros[Double](partRows.length, col)
    -      var i = 0
    -      partRows.foreach { row =>
    -        bdm(i, ::) := row.asBreeze.t
    -        i += 1
    +      if (partRows.length == 0) {
    --- End diff --
    
    Can you just flatMap this? so that you don't have to handle None below? or 
filter then map?


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to