cloud-fan commented on code in PR #40734:
URL: https://github.com/apache/spark/pull/40734#discussion_r1162886055
##########
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:
we can probably follow v1 write and trigger a nested execution to do table
insertion in CTAS/RTAS command:
https://github.com/apache/spark/commit/4b40920e33176fc8b18380703e4dcf4d16824094
--
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]