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_r350212404
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/types/StructType.scala
 ##########
 @@ -526,6 +526,25 @@ object StructType extends AbstractDataType {
       case _ => dt
     }
 
+  /**
+   * Function to merge the two DataTypes that is compatible with the left
+   * and right side. The order is:
+   *
+   * 1. Merge Arrays, where the type of the Arrays should be compatible
+   * 2. Merge Maps, where the type of the Maps should be compatible
+   * 3. Merge Structs, where the struct recursively checked for compatibility
+   * 4. Merge DecimalType, where the scale and precision should be equal
+   * 5. Merge UserDefinedType, where the underlying class is equal
+   * 6. Merge UserDefinedType into DataType, where the underlying DataType is 
equal
+   * 7. Merge DataType, where we check if the DataTypes are compatible
+   * 8. Unable to determine compatibility or incompatible, throw exception
 
 Review comment:
   Sure

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

Reply via email to