Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Licensed to the Apache Software Foundation (ASF) under one or more
0003  * contributor license agreements.  See the NOTICE file distributed with
0004  * this work for additional information regarding copyright ownership.
0005  * The ASF licenses this file to You under the Apache License, Version 2.0
0006  * (the "License"); you may not use this file except in compliance with
0007  * the License.  You may obtain a copy of the License at
0008  *
0009  *    http://www.apache.org/licenses/LICENSE-2.0
0010  *
0011  * Unless required by applicable law or agreed to in writing, software
0012  * distributed under the License is distributed on an "AS IS" BASIS,
0013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0014  * See the License for the specific language governing permissions and
0015  * limitations under the License.
0016  */
0017 package org.apache.spark.sql;
0018 
0019 import org.apache.spark.annotation.Stable;
0020 
0021 /**
0022  * SaveMode is used to specify the expected behavior of saving a DataFrame to a data source.
0023  *
0024  * @since 1.3.0
0025  */
0026 @Stable
0027 public enum SaveMode {
0028   /**
0029    * Append mode means that when saving a DataFrame to a data source, if data/table already exists,
0030    * contents of the DataFrame are expected to be appended to existing data.
0031    *
0032    * @since 1.3.0
0033    */
0034   Append,
0035   /**
0036    * Overwrite mode means that when saving a DataFrame to a data source,
0037    * if data/table already exists, existing data is expected to be overwritten by the contents of
0038    * the DataFrame.
0039    *
0040    * @since 1.3.0
0041    */
0042   Overwrite,
0043   /**
0044    * ErrorIfExists mode means that when saving a DataFrame to a data source, if data already exists,
0045    * an exception is expected to be thrown.
0046    *
0047    * @since 1.3.0
0048    */
0049   ErrorIfExists,
0050   /**
0051    * Ignore mode means that when saving a DataFrame to a data source, if data already exists,
0052    * the save operation is expected to not save the contents of the DataFrame and to not
0053    * change the existing data.
0054    *
0055    * @since 1.3.0
0056    */
0057   Ignore
0058 }