Kimahriman commented on a change in pull request #32448: URL: https://github.com/apache/spark/pull/32448#discussion_r631516011
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveUnion.scala ########## @@ -181,7 +100,12 @@ object ResolveUnion extends Rule[LogicalPlan] { // like that. We will sort columns in the struct expression to make sure two sides of // union have consistent schema. aliased += foundAttr - Alias(addFields(foundAttr, target), foundAttr.name)() + val targetType = try { + target.merge(source, conf.resolver) + } catch { case e: Throwable => + throw QueryExecutionErrors.failedToMergeIncompatibleSchemasError(target, source, e) Review comment: Done -- 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 --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org