Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/4446#discussion_r24389467
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala ---
@@ -608,21 +637,82 @@ trait DataFrame extends RDDApi[Row] {
def saveAsTable(
tableName: String,
dataSourceName: String,
+ mode: SaveMode,
options: java.util.Map[String, String]): Unit
+ /**
+ * :: Experimental ::
+ * (Scala-specific)
+ * Creates a table from the the contents of this DataFrame based on a
given data source,
+ * [[SaveMode]] specified by mode, and a set of options.
+ *
+ * Note that this currently only works with DataFrames that are created
from a HiveContext as
+ * there is no notion of a persisted catalog in a standard SQL context.
Instead you can write
+ * an RDD out to a parquet file, and then register that file as a table.
This "table" can then
+ * be the target of an `insertInto`.
+ */
+ @Experimental
+ def saveAsTable(
+ tableName: String,
+ dataSourceName: String,
+ mode: SaveMode,
+ options: Map[String, String]): Unit
+
+ /**
+ * :: Experimental ::
+ * Saves the contents of this DataFrame to the given path,
+ * using the default data source configured by spark.sql.sources.default
and
+ * [[SaveMode.ErrorIfExists]] as the save mode.
+ */
@Experimental
def save(path: String): Unit
+ /**
+ * :: Experimental ::
+ * Saves the contents of this DataFrame to the given path and
[[SaveMode]] specified by mode,
+ * using the default data source configured by spark.sql.sources.default.
+ */
+ @Experimental
+ def save(path: String, mode: SaveMode): Unit
+
+ /**
+ * :: Experimental ::
+ * Saves the contents of this DataFrame to the given path based on the
given data source,
+ * using [[SaveMode.ErrorIfExists]] as the save mode.
+ */
+ @Experimental
+ def save(path: String, dataSourceName: String): Unit
+
+ /**
+ * :: Experimental ::
+ * Saves the contents of this DataFrame to the given path based on the
given data source and
+ * [[SaveMode]] specified by mode.
+ */
+ @Experimental
+ def save(path: String, dataSourceName: String, mode: SaveMode): Unit
+
+ /**
+ * :: Experimental ::
+ * Saves the contents of this DataFrame based on the given data source,
+ * [[SaveMode]] specified by mode, and a set of options.
+ */
@Experimental
def save(
dataSourceName: String,
- option: (String, String),
- options: (String, String)*): Unit
+ mode: SaveMode,
+ options: java.util.Map[String, String]): Unit
+ /**
+ * :: Experimental ::
+ * (Scala-specific)
+ * Saves the contents of this DataFrame based on the given data source,
+ * [[SaveMode]] specified by mode, and a set of options
+ */
@Experimental
def save(
--- End diff --
same for save
---
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]