srowen commented on a change in pull request #24793: [SPARK-27944][ML] Unify
the behavior of checking empty output column names
URL: https://github.com/apache/spark/pull/24793#discussion_r302581467
##########
File path:
mllib/src/main/scala/org/apache/spark/ml/clustering/BisectingKMeans.scala
##########
@@ -107,9 +107,15 @@ class BisectingKMeansModel private[ml] (
@Since("2.0.0")
override def transform(dataset: Dataset[_]): DataFrame = {
transformSchema(dataset.schema, logging = true)
- val predictUDF = udf((vector: Vector) => predict(vector))
- dataset.withColumn($(predictionCol),
- predictUDF(DatasetUtils.columnToVector(dataset, getFeaturesCol)))
+ if ($(predictionCol).nonEmpty) {
Review comment:
Likewise how would this be empty, unless the user set it to nothing? in
which case, this seems not worth worrying about
----------------------------------------------------------------
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]