Github user mgaido91 commented on a diff in the pull request:
https://github.com/apache/spark/pull/21274#discussion_r187159250
--- Diff:
mllib/src/main/scala/org/apache/spark/ml/clustering/PowerIterationClustering.scala
---
@@ -231,8 +231,12 @@ class PowerIterationClustering private[clustering] (
dataset.schema($(idCol)).dataType match {
case _: LongType =>
uncastPredictions
+ case _: IntegerType =>
+ uncastPredictions.withColumn($(idCol),
col($(idCol)).cast(LongType))
case otherType =>
-
uncastPredictions.select(col($(idCol)).cast(otherType).alias($(idCol)))
+ throw new IllegalArgumentException(s"PowerIterationClustering
had an unexpected error: " +
+ s"ID col was found to be of type $otherType, despite initial
schema checks. Please " +
--- End diff --
nit: ${otherType.simpleString}
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]