srowen commented on a change in pull request #27600: [MINOR][ML] ML cleanup
URL: https://github.com/apache/spark/pull/27600#discussion_r381603214
##########
File path: mllib/src/main/scala/org/apache/spark/ml/recommendation/ALS.scala
##########
@@ -1049,7 +1049,7 @@ object ALS extends DefaultParamsReadable[ALS] with
Logging {
.join(userFactors)
.mapPartitions({ items =>
items.flatMap { case (_, (ids, factors)) =>
- ids.view.zip(factors)
+ ids.iterator.zip(factors.iterator)
Review comment:
Hm, but it results in a new array already, so just removing .view seems to
not change much here. Just in case @mengxr do you recall why? this was written
4 years ago, so may have been lost in time.
The result would now be an iterator, which seems OK; avoids allocating an
array after the change, I believe.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]