Github user WeichenXu123 commented on a diff in the pull request:
https://github.com/apache/spark/pull/18281#discussion_r128645326
--- Diff:
mllib/src/main/scala/org/apache/spark/ml/classification/OneVsRest.scala ---
@@ -337,8 +353,13 @@ final class OneVsRest @Since("1.4.0") (
paramMap.put(classifier.labelCol -> labelColName)
paramMap.put(classifier.featuresCol -> getFeaturesCol)
paramMap.put(classifier.predictionCol -> getPredictionCol)
- classifier.fit(trainingDataset, paramMap)
- }.toArray[ClassificationModel[_, _]]
+ Future {
+ classifier.fit(trainingDataset, paramMap)
+ }(executionContext)
+ }
+ val models = modelFutures
+ .map(ThreadUtils.awaitResult(_,
Duration.Inf)).toArray[ClassificationModel[_, _]]
--- End diff --
@holdenk Because `ThreadUtils.awaitResult` wraps and re-throws any
exceptions thrown by the underlying `Await` call, ensuring that this thread's
stack trace appears in logs
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]