WeichenXu123 commented on code in PR #47283:
URL: https://github.com/apache/spark/pull/47283#discussion_r1677300955


##########
mllib/src/main/scala/org/apache/spark/ml/feature/StringIndexer.scala:
##########
@@ -124,10 +126,18 @@ private[feature] trait StringIndexerBase extends Params 
with HasHandleInvalid wi
 
     val outputFields = inputColNames.zip(outputColNames).flatMap {
       case (inputColName, outputColName) =>
-        schema.fieldNames.contains(inputColName) match {
-          case true => Some(validateAndTransformField(schema, inputColName, 
outputColName))
-          case false if skipNonExistsCol => None
-          case _ => throw new SparkException(s"Input column $inputColName does 
not exist.")
+        try {
+          val dtype = _transformDataset.col(inputColName).expr.dataType

Review Comment:
   renamed .



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to