HyukjinKwon 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_r362722368
 
 

 ##########
 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:
   @Fokko, sorry for my late response. I doubt if we should allow this case.
   
   Currently, `merge` only allows the same types but UDT <> UDT's SQL types are 
not the same types. I think it makes less sense to allow this case alone.
   
   Also, this https://github.com/apache/spark/pull/26644/files#r350486670 looks 
weird. `jsonValue` seems it should have JSON-serialized value of its own type.

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


With regards,
Apache Git Services

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

Reply via email to