aokolnychyi commented on code in PR #40734:
URL: https://github.com/apache/spark/pull/40734#discussion_r1162265053


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2Strategy.scala:
##########
@@ -184,19 +175,23 @@ class DataSourceV2Strategy(session: SparkSession) extends 
Strategy with Predicat
         newSchema, catalog.asTableCatalog, ident, "CREATE TABLE")
 
       CreateTableExec(catalog.asTableCatalog, ident, 
structTypeToV2Columns(newSchema),
-        partitioning, qualifyLocInTableSpec(tableSpec), ifNotExists) :: Nil
+        partitioning, qualifyLocInTableSpec(session, tableSpec), ifNotExists) 
:: Nil
 
     case CreateTableAsSelect(ResolvedIdentifier(catalog, ident), parts, query, 
tableSpec,
-        options, ifNotExists, analyzedQuery) =>
+        options, ifNotExists, analyzedQuery, table, write) =>
       assert(analyzedQuery.isDefined)
       val writeOptions = new CaseInsensitiveStringMap(options.asJava)
       catalog match {
         case staging: StagingTableCatalog =>
-          AtomicCreateTableAsSelectExec(staging, ident, parts, 
analyzedQuery.get, planLater(query),
-            qualifyLocInTableSpec(tableSpec), writeOptions, ifNotExists) :: Nil
+          assert(table.isDefined)
+          assert(write.isDefined)
+          AtomicCreateTableAsSelectExec(

Review Comment:
   This PR focuses on atomic CTAS/RTAS as we can safely stage a new table in 
the optimizer and then write to it during the execution. I don't have a good 
solution for non-atomic CTAS/RTAS. Any ideas are appreciated.



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