maropu commented on a change in pull request #29587:
URL: https://github.com/apache/spark/pull/29587#discussion_r479980351
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/types/StructType.scala
##########
@@ -641,4 +641,30 @@ object StructType extends AbstractDataType {
fields.foreach(s => map.put(s.name, s))
map
}
+
+ /**
+ * Returns a `StructType` that contains missing fields recursively from
`source` to `target`.
+ * Note that this doesn't support looking into array type and map type
recursively.
+ */
+ def findMissingFields(source: StructType, target: StructType, resolver:
Resolver): StructType = {
Review comment:
We need to define this method in the `StructType` side instead of a
private method in `ResolveUnion`?
----------------------------------------------------------------
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]