|
||||
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 0018 package org.apache.spark.sql.connector.catalog; 0019 0020 import java.util.Map; 0021 0022 import org.apache.spark.annotation.Evolving; 0023 import org.apache.spark.sql.connector.expressions.Transform; 0024 import org.apache.spark.sql.connector.write.LogicalWriteInfo; 0025 import org.apache.spark.sql.types.StructType; 0026 0027 /** 0028 * Represents a table which is staged for being committed to the metastore. 0029 * <p> 0030 * This is used to implement atomic CREATE TABLE AS SELECT and REPLACE TABLE AS SELECT queries. The 0031 * planner will create one of these via 0032 * {@link StagingTableCatalog#stageCreate(Identifier, StructType, Transform[], Map)} or 0033 * {@link StagingTableCatalog#stageReplace(Identifier, StructType, Transform[], Map)} to prepare the 0034 * table for being written to. This table should usually implement {@link SupportsWrite}. A new 0035 * writer will be constructed via {@link SupportsWrite#newWriteBuilder(LogicalWriteInfo)}, and the 0036 * write will be committed. The job concludes with a call to {@link #commitStagedChanges()}, at 0037 * which point implementations are expected to commit the table's metadata into the metastore along 0038 * with the data that was written by the writes from the write builder this table created. 0039 * 0040 * @since 3.0.0 0041 */ 0042 @Evolving 0043 public interface StagedTable extends Table { 0044 0045 /** 0046 * Finalize the creation or replacement of this table. 0047 */ 0048 void commitStagedChanges(); 0049 0050 /** 0051 * Abort the changes that were staged, both in metadata and from temporary outputs of this 0052 * table's writers. 0053 */ 0054 void abortStagedChanges(); 0055 }
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.1.0 LXR engine. The LXR team |