Github user marmbrus commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3780#discussion_r22762698
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/SchemaRDDLike.scala 
---
    @@ -68,12 +68,29 @@ private[sql] trait SchemaRDDLike {
       /**
        * Saves the contents of this `SchemaRDD` as a parquet file, preserving 
the schema.  Files that
        * are written out using this method can be read back in as a SchemaRDD 
using the `parquetFile`
    -   * function.
    +   * function. It will raise exception if the specified path already 
existed.
        *
    +   * @param path   The destination path.
        * @group schema
        */
       def saveAsParquetFile(path: String): Unit = {
    -    sqlContext.executePlan(WriteToFile(path, logicalPlan)).toRdd
    +    // We provide override functions for the ability of default function 
argument value,
    +    // which is not naturely supported by Java
    +    saveAsParquetFile(path, false)
    +  }
    +
    +  /**
    +   * Saves the contents of this `SchemaRDD` as a parquet file, preserving 
the schema.  Files that
    +   * are written out using this method can be read back in as a SchemaRDD 
using the `parquetFile`
    +   * function.
    +   * @param path      The destination path.
    +   * @param overwrite If it's false, an exception will raise if the path 
already existed,
    --- End diff --
    
    I'm not sure if I agree with this semantic as its explained.  I think we 
actually have to blow away the directory if is it there.  What about when there 
is a larger dataset being replaced by a smaller one.  You don't want to end up 
with half and half.


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