Github user thunterdb commented on a diff in the pull request: https://github.com/apache/spark/pull/10146#discussion_r48805286 --- Diff: mllib/src/main/scala/org/apache/spark/mllib/stat/test/ChiSqTest.scala --- @@ -109,7 +109,9 @@ private[stat] object ChiSqTest extends Logging { } i += 1 distinctLabels += label - features.toArray.view.zipWithIndex.slice(startCol, endCol).map { case (feature, col) => + val featureArray = features.toArray + (startCol until endCol).map { col => + val feature = featureArray(col) --- End diff -- ah yes, good catch about the view that builds incrementally a copy of the feature vectors. Let's also remove the `featureArray`, we can call directly `val feature = features(col)`
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org