org.apache.spark.sql
Enum SaveMode

Object
  extended by Enum<SaveMode>
      extended by org.apache.spark.sql.SaveMode
All Implemented Interfaces:
java.io.Serializable, Comparable<SaveMode>

public enum SaveMode
extends Enum<SaveMode>

SaveMode is used to specify the expected behavior of saving a DataFrame to a data source.

Since:
1.3.0

Enum Constant Summary
Append
          Append mode means that when saving a DataFrame to a data source, if data/table already exists, contents of the DataFrame are expected to be appended to existing data.
ErrorIfExists
          ErrorIfExists mode means that when saving a DataFrame to a data source, if data already exists, an exception is expected to be thrown.
Ignore
          Ignore mode means that when saving a DataFrame to a data source, if data already exists, the save operation is expected to not save the contents of the DataFrame and to not change the existing data.
Overwrite
          Overwrite mode means that when saving a DataFrame to a data source, if data/table already exists, existing data is expected to be overwritten by the contents of the DataFrame.
 
Method Summary
static SaveMode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static SaveMode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

Append

public static final SaveMode Append
Append mode means that when saving a DataFrame to a data source, if data/table already exists, contents of the DataFrame are expected to be appended to existing data.

Since:
1.3.0

Overwrite

public static final SaveMode Overwrite
Overwrite mode means that when saving a DataFrame to a data source, if data/table already exists, existing data is expected to be overwritten by the contents of the DataFrame.

Since:
1.3.0

ErrorIfExists

public static final SaveMode ErrorIfExists
ErrorIfExists mode means that when saving a DataFrame to a data source, if data already exists, an exception is expected to be thrown.

Since:
1.3.0

Ignore

public static final SaveMode Ignore
Ignore mode means that when saving a DataFrame to a data source, if data already exists, the save operation is expected to not save the contents of the DataFrame and to not change the existing data.

Since:
1.3.0
Method Detail

values

public static SaveMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (SaveMode c : SaveMode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static SaveMode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null