You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2018/12/28 18:29:30 UTC

[GitHub] holdenk commented on a change in pull request #21509: [SPARK-24489][ML]Check for invalid input type of weight data in ml.PowerIterationClustering

holdenk commented on a change in pull request #21509: [SPARK-24489][ML]Check for invalid input type of weight data in ml.PowerIterationClustering
URL: https://github.com/apache/spark/pull/21509#discussion_r244380105
 
 

 ##########
 File path: mllib/src/main/scala/org/apache/spark/ml/clustering/PowerIterationClustering.scala
 ##########
 @@ -166,6 +166,8 @@ class PowerIterationClustering private[clustering] (
     val w = if (!isDefined(weightCol) || $(weightCol).isEmpty) {
       lit(1.0)
     } else {
+      SchemaUtils.checkColumnTypes(dataset.schema, $(weightCol), Seq(FloatType, DoubleType,
 
 Review comment:
   There is a built in function called `checkNumericType` which I think might be what you want to use (unless we don't support decimal input types here)?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org