gengliangwang commented on a change in pull request #25453: [WIP][SPARK-28730][SQL] Configurable type coercion policy for table insertion URL: https://github.com/apache/spark/pull/25453#discussion_r315527952
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala ########## @@ -2525,7 +2525,8 @@ class Analyzer( override def apply(plan: LogicalPlan): LogicalPlan = plan.resolveOperators { case append @ AppendData(table, query, isByName) if table.resolved && query.resolved && !append.outputResolved => - val projection = resolveOutputColumns(table.name, table.output, query, isByName) + val projection = + TableOutputResolver.resolveOutputColumns(table.name, table.output, query, isByName, conf) Review comment: > The code in line2528-2535, line2539-2546, and line2550-2557 is duplicate, so can we merge them into one rule by defining an extractor(unapply)? Eventually we need to call `append.copy(query = projection)` and `overwrite.copy(query = projection)`, we need to match all the `V2WriteCommand` anyway. I think it is fine to keep the current code. ---------------------------------------------------------------- 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