Skip to content

Commit 2e34f3c

Browse files
committed
add actual type in the error message
1 parent ad938bf commit 2e34f3c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mllib/src/main/scala/org/apache/spark/ml/feature/StringIndexer.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ private[feature] trait StringIndexerBase extends Params with HasInputCol with Ha
3939
val inputColName = map(inputCol)
4040
val inputDataType = schema(inputColName).dataType
4141
require(inputDataType == StringType || inputDataType.isInstanceOf[NumericType],
42-
s"The input column $inputColName must be either string type or numeric type.")
42+
s"The input column $inputColName must be either string type or numeric type, " +
43+
s"but got $inputDataType.")
4344
val inputFields = schema.fields
4445
val outputColName = map(outputCol)
4546
require(inputFields.forall(_.name != outputColName),

0 commit comments

Comments
 (0)