You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2026/08/20 15:16:54 UTC

[PR] [SPARK-58912][ML] Use integer counts in CountVectorizer transform [spark]

zhengruifeng opened a new pull request, #58170:
URL: https://github.com/apache/spark/pull/58170

   ### What changes were proposed in this pull request?
   
   This PR changes the temporary per-row count map used by `CountVectorizerModel.transform` from
   `OpenHashMap[Int, Double]` to `OpenHashMap[Int, Int]`.
   
   The transform path only increments word counts by one while scanning the input document. The
   counts are converted to `Double` when constructing the output sparse vector.
   
   ### Why are the changes needed?
   
   Using integer values in the temporary map reduces memory used while counting words for each input
   document. The output vector still uses `Double` values, so the external behavior is unchanged.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Not run; change is covered by existing `CountVectorizerSuite` transform coverage.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Codex (GPT-5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-58912][ML] Use integer counts in CountVectorizer transform [spark]

Posted by "uros-b (via GitHub)" <gi...@apache.org>.
uros-b commented on PR #58170:
URL: https://github.com/apache/spark/pull/58170#issuecomment-5363133051

   Thank you @zhengruifeng!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-58912][ML] Use integer counts in CountVectorizer transform [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #58170: [SPARK-58912][ML] Use integer counts in CountVectorizer transform
URL: https://github.com/apache/spark/pull/58170


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-58912][ML] Use integer counts in CountVectorizer transform [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #58170:
URL: https://github.com/apache/spark/pull/58170#issuecomment-5363608315

   **Merge Summary:**
   - merged into master https://github.com/apache/spark/commit/e7470b4b41ce72d6164cbc784b0a459d5deb6851
   - merged into branch-4.x https://github.com/apache/spark/commit/c2c335a80f2b676438889da8ab81ef2a567ff626
   
   *Posted by `merge_spark_pr.py`*


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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