srowen commented on a change in pull request #28291:
URL: https://github.com/apache/spark/pull/28291#discussion_r413836927
##########
File path: mllib/src/main/scala/org/apache/spark/ml/util/SchemaUtils.scala
##########
@@ -40,9 +40,10 @@ private[spark] object SchemaUtils {
msg: String = ""): Unit = {
val actualDataType = schema(colName).dataType
val message = if (msg != null && msg.trim.length > 0) " " + msg else ""
- require(actualDataType.equals(dataType),
- s"Column $colName must be of type ${dataType.catalogString} but was
actually " +
- s"${actualDataType.catalogString}.$message")
+ require(actualDataType.getClass.equals(dataType.getClass) &&
Review comment:
I mean I don't think you need this extra check; it already fails. I'm
also not sure if this ends up being overly restrictive in some other cases.
It's the message that's not helpful. The message update is sound.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]