cloud-fan commented on a change in pull request #27992: [SPARK-31230][SQL] Use 
statement plans in DataFrameWriter(V2)
URL: https://github.com/apache/spark/pull/27992#discussion_r397706854
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriterV2.scala
 ##########
 @@ -120,19 +117,18 @@ final class DataFrameWriterV2[T] private[sql](table: 
String, ds: Dataset[T])
   }
 
   override def create(): Unit = {
-    // create and replace could alternatively create ParsedPlan statements, 
like
-    // `CreateTableFromDataFrameStatement(UnresolvedRelation(tableName), 
...)`, to keep the catalog
-    // resolution logic in the analyzer.
     runCommand("create") {
-      CreateTableAsSelect(
-        catalog,
-        identifier,
-        partitioning.getOrElse(Seq.empty),
+      CreateTableAsSelectStatement(
 
 Review comment:
   The `Create/ReplaceTableAsSelectStatement` has an `options` field, which is 
used as the write options, see
   
   
https://github.com/apache/spark/blob/27d53de10faa907a53a979b66282a457767b33ba/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveCatalogs.scala#L163
   
   
https://github.com/apache/spark/blob/27d53de10faa907a53a979b66282a457767b33ba/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveCatalogs.scala#L189
   
   
https://github.com/apache/spark/blob/27d53de10faa907a53a979b66282a457767b33ba/sql/core/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveSessionCatalog.scala#L296
   
   
https://github.com/apache/spark/blob/27d53de10faa907a53a979b66282a457767b33ba/sql/core/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveSessionCatalog.scala#L335

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

Reply via email to