You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/08/31 16:15:56 UTC
[GitHub] [spark] viirya commented on a change in pull request #29587: [SPARK-32376][SQL] Make unionByName null-filling behavior work with struct columns
viirya commented on a change in pull request #29587:
URL: https://github.com/apache/spark/pull/29587#discussion_r480237210
##########
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:
I feel this is more general method related to `StructType`. So putting it in `StructType`.
----------------------------------------------------------------
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org