gengliangwang commented on code in PR #36445:
URL: https://github.com/apache/spark/pull/36445#discussion_r870476354


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveDefaultColumns.scala:
##########
@@ -441,17 +504,21 @@ case class ResolveDefaultColumns(
    */
   private def getSchemaForTargetTable(table: LogicalPlan): Option[StructType] 
= {
     // Check if the target table is already resolved. If so, return the 
computed schema.
-    table match {
-      case r: NamedRelation if r.schema.fields.nonEmpty => return 
Some(r.schema)
-      case SubqueryAlias(_, r: NamedRelation) if r.schema.fields.nonEmpty => 
return Some (r.schema)
-      case _ =>
+    val source: Option[LogicalPlan] = table.collectFirst {

Review Comment:
   Why changing the code here?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to