Fokko commented on a change in pull request #26644: [SPARK-30004][SQL] Allow merge UserDefinedType into a native DataType URL: https://github.com/apache/spark/pull/26644#discussion_r363110958
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/types/StructType.scala ########## @@ -592,6 +597,12 @@ object StructType extends AbstractDataType { case (leftUdt: UserDefinedType[_], rightUdt: UserDefinedType[_]) if leftUdt.userClass == rightUdt.userClass => leftUdt + case (leftType, rightUdt: UserDefinedType[_]) + if leftType == rightUdt.sqlType => leftType + + case (leftUdt: UserDefinedType[_], rightType) + if leftUdt.sqlType == rightType => rightType Review comment: Well, the `UserDefinedType` extends `DataType`, similar to `TimestampType`, `StringType`, and any other type. The thing is that a UserDefinedType can be compatible with any other type. For example, it is allowed to merge an int into a long. This is an explicit choice by the developer. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org