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/27 02:37:43 UTC
[PR] [FOLLOWUP][ML] Avoid intermediate collections in CountVectorizer transform [spark]
zhengruifeng opened a new pull request, #58325:
URL: https://github.com/apache/spark/pull/58325
### What changes were proposed in this pull request?
This follow-up to #58170 starts the `CountVectorizerModel` count filtering and conversion
pipelines from an iterator for both binary and non-binary output.
### Why are the changes needed?
`OpenHashMap` is a strict `Iterable`, so calling `filter` and `map` on it materializes intermediate
collections for every transformed document. Using its iterator keeps those operations lazy and
materializes only the sequence required by `Vectors.sparse`.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Not run. This only changes collection evaluation from strict to lazy; existing
`CountVectorizerSuite` transform tests cover the output behavior. `git diff --check` passes.
### 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][FOLLOWUP] Avoid intermediate collections in CountVectorizer transform [spark]
Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #58325:
URL: https://github.com/apache/spark/pull/58325#issuecomment-5447443937
**Merge Summary:**
- merged into master https://github.com/apache/spark/commit/b9b9facbae181bdd90cc131fe3bf32241497d3c7
- merged into branch-4.x https://github.com/apache/spark/commit/0f19599f463a5f4c99e4a635504419059881b902
*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
Re: [PR] [SPARK-58912][ML][FOLLOWUP] Avoid intermediate collections in CountVectorizer transform [spark]
Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #58325: [SPARK-58912][ML][FOLLOWUP] Avoid intermediate collections in CountVectorizer transform
URL: https://github.com/apache/spark/pull/58325
--
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