gengliangwang commented on a change in pull request #35855:
URL: https://github.com/apache/spark/pull/35855#discussion_r834406690



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2Strategy.scala
##########
@@ -187,12 +190,14 @@ class DataSourceV2Strategy(session: SparkSession) extends 
Strategy with Predicat
       RefreshTableExec(r.catalog, r.identifier, recacheTable(r)) :: Nil
 
     case ReplaceTable(ResolvedDBObjectName(catalog, ident), schema, parts, 
tableSpec, orCreate) =>
+      val newSchema: StructType =
+        
ResolveDefaultColumns.constantFoldCurrentDefaultsToExistDefaults(schema, 
"CREATE TABLE")

Review comment:
       I suggest passing the analyzer via function parameter
   ```
   session.sessionState.analyzer
   ```
   instead of creating a new one in object `ResolveDefaultColumns`
   After supporting multiple catalogs, different catalogs will have different 
SQL functions which can be used in default values.




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