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 2022/05/18 14:28:40 UTC

[GitHub] [spark] gengliangwang commented on a diff in pull request #36475: [SPARK-38869][SQL] Respect table capability ACCEPT_ANY_SCHEMA in DEFAULT column resolution

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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveDefaultColumns.scala:
##########
@@ -522,6 +523,20 @@ case class ResolveDefaultColumns(
       case _ => return None
     }
     val lookup: LogicalPlan = try {
+      // Check if the target table has "ACCEPT_ANY_SCHEMA" capabilities and if so,
+      // don't do anything.
+      analyzer.currentCatalog match {

Review Comment:
   Shall we match if `source` is `DataSourceV2Relation` instead? With multiple catalog supports, the current catalog doesn't have to be the catalog of `source`.
   For example:
   ```
   set catalog catalog_a
   insert into catalog_b.db.tableName
   ```



-- 
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: reviews-unsubscribe@spark.apache.org

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