List of usage examples for org.apache.spark.sql SaveMode ErrorIfExists
SaveMode ErrorIfExists
To view the source code for org.apache.spark.sql SaveMode ErrorIfExists.
Click Source Link
From source file:com.thinkbiganalytics.kylo.catalog.spark.SparkUtil.java
License:Apache License
/** * Returns the save mode with the specified name. * * @throws IllegalArgumentException if no save mode has the specified name *//*from w w w .j a va 2 s . c o m*/ @Nonnull public static SaveMode toSaveMode(final String s) { Preconditions.checkNotNull(s, "Save mode cannot be null"); switch (s.toLowerCase()) { case "overwrite": return SaveMode.Overwrite; case "append": return SaveMode.Append; case "ignore": return SaveMode.Ignore; case "error": case "errorifexists": case "default": return SaveMode.ErrorIfExists; default: log.debug("Unknown save mode: {}", s); throw new IllegalArgumentException("Unknown save mode: " + s + ". Accepted save modes are 'overwrite', 'append', 'ignore', 'error', 'errorifexists'."); } }