Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3780#discussion_r22278028
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala ---
    @@ -199,11 +199,15 @@ private[sql] abstract class SparkStrategies extends 
QueryPlanner[SparkPlan] {
       object ParquetOperations extends Strategy {
         def apply(plan: LogicalPlan): Seq[SparkPlan] = plan match {
           // TODO: need to support writing to other types of files.  Unify the 
below code paths.
    -      case logical.WriteToFile(path, child) =>
    +      case logical.WriteToFile(path, child, overwrite) =>
             val relation =
    -          ParquetRelation.create(path, child, 
sparkContext.hadoopConfiguration, sqlContext)
    -        // Note: overwrite=false because otherwise the metadata we just 
created will be deleted
    -        InsertIntoParquetTable(relation, planLater(child), overwrite = 
false) :: Nil
    +          ParquetRelation.createEmpty(
    --- End diff --
    
    Is it safe to replace `create` with `createEmpty`? I see `create` will do 
some check and then call `createEmpty`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to