Enum SaveMode

  • All Implemented Interfaces:
    Serializable, Comparable<SaveMode>

    public enum SaveMode
    extends Enum<SaveMode>
    SaveMode configures the behavior when data is written from a DataFrame to a data source using a DataFrameWriter instance.

    Append: In the Append mode, new data is appended to the datasource.

    Overwrite: In the Overwrite mode, existing data is overwritten with the new data. If the datasource is a table, then the existing data in the table is replaced.

    ErrorIfExists: In the ErrorIfExists mode, an error is thrown if the data being written already exists in the data source.

    Ignore: In the Ignore mode, if the data already exists, the write operation is not expected to update existing data.

    • Enum Constant Detail

      • Append

        public static final SaveMode Append
      • Overwrite

        public static final SaveMode Overwrite
      • ErrorIfExists

        public static final SaveMode ErrorIfExists
      • Ignore

        public static final SaveMode Ignore
    • 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())
        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.)
        name - the name of the enum constant to be returned.
        the enum constant with the specified name
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null