Github user mpjlu commented on a diff in the pull request:
    --- Diff: 
mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala ---
    @@ -635,8 +642,9 @@ class SparseVector @Since("2.0.0") (
    -  override def toSparse: SparseVector = {
    -    val nnz = numNonzeros
    +  override def toSparse: SparseVector = toSparse(numNonzeros)
    --- End diff --
    If define 
    `def toSparse: SparseVector = toSparse(numNonzeros)`
    in the superclass, when call dv.toSparse (there are this kinds of call in 
the code), there will be error message:
    Both toSparse in the DenseVector of type (nnz:Int) and toSparse in trait Vector of type 
=> match  .
    So we should change the name of toSparse(nnz: Int), maybe 
toSparseWithSize(nnz: Int).

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

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to