From 7bf5d1962aa750079da313cd6d106bf8c616d448 Mon Sep 17 00:00:00 2001 From: Jacek Laskowski Date: Thu, 18 May 2017 09:56:28 +0200 Subject: [PATCH 1/2] [SPARK-16202][SQL][DOC] Follow-up to Correct The Description of CreatableRelationProvider's createRelation --- .../org/apache/spark/sql/sources/interfaces.scala | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/sql/core/src/main/scala/org/apache/spark/sql/sources/interfaces.scala b/sql/core/src/main/scala/org/apache/spark/sql/sources/interfaces.scala index ff8b15b3ff3ff..391de7955879a 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/sources/interfaces.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/sources/interfaces.scala @@ -163,16 +163,10 @@ trait StreamSinkProvider { @InterfaceStability.Stable trait CreatableRelationProvider { /** - * Save the DataFrame to the destination and return a relation with the given parameters based on - * the contents of the given DataFrame. The mode specifies the expected behavior of createRelation - * when data already exists. - * Right now, there are three modes, Append, Overwrite, and ErrorIfExists. - * Append mode means that when saving a DataFrame to a data source, if data already exists, - * contents of the DataFrame are expected to be appended to existing data. - * Overwrite mode means that when saving a DataFrame to a data source, if data already exists, - * existing data is expected to be overwritten by the contents of the DataFrame. - * ErrorIfExists mode means that when saving a DataFrame to a data source, - * if data already exists, an exception is expected to be thrown. + * Saves a DataFrame to a destination (using data source-specific parameters) + * + * @param mode specifies what happens when the destination already exists + * @param parameters data source-specific parameters * * @since 1.3.0 */ From 97a691c758587ef27fe3a3448a8e886458fdc75e Mon Sep 17 00:00:00 2001 From: Jacek Laskowski Date: Fri, 19 May 2017 22:51:28 +0200 Subject: [PATCH 2/2] After review --- .../main/scala/org/apache/spark/sql/sources/interfaces.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sql/core/src/main/scala/org/apache/spark/sql/sources/interfaces.scala b/sql/core/src/main/scala/org/apache/spark/sql/sources/interfaces.scala index 391de7955879a..86eeb2f7dd419 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/sources/interfaces.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/sources/interfaces.scala @@ -165,8 +165,11 @@ trait CreatableRelationProvider { /** * Saves a DataFrame to a destination (using data source-specific parameters) * + * @param sqlContext SQLContext * @param mode specifies what happens when the destination already exists * @param parameters data source-specific parameters + * @param data DataFrame to save (i.e. the rows after executing the query) + * @return Relation with a known schema * * @since 1.3.0 */