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

    https://github.com/apache/spark/pull/17459#discussion_r118793854
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/IndexedRowMatrix.scala
 ---
    @@ -108,8 +108,69 @@ class IndexedRowMatrix @Since("1.0.0") (
        */
       @Since("1.3.0")
       def toBlockMatrix(rowsPerBlock: Int, colsPerBlock: Int): BlockMatrix = {
    -    // TODO: This implementation may be optimized
    -    toCoordinateMatrix().toBlockMatrix(rowsPerBlock, colsPerBlock)
    +    require(rowsPerBlock > 0,
    +      s"rowsPerBlock needs to be greater than 0. rowsPerBlock: 
$rowsPerBlock")
    +    require(colsPerBlock > 0,
    +      s"colsPerBlock needs to be greater than 0. colsPerBlock: 
$colsPerBlock")
    +
    +    // Since block matrices require an integer row index
    +    require(numRows() / rowsPerBlock < Int.MaxValue,
    --- End diff --
    
    Well, it's true if I do floating point division. It's not necessarily true 
if it's long / int division. 


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