Interface StagedTable

All Superinterfaces:

@Evolving public interface StagedTable extends Table
Represents a table which is staged for being committed to the metastore.

This is used to implement atomic CREATE TABLE AS SELECT and REPLACE TABLE AS SELECT queries. The planner will create one of these via StagingTableCatalog.stageCreate(Identifier, StructType, Transform[], Map) or StagingTableCatalog.stageReplace(Identifier, StructType, Transform[], Map) to prepare the table for being written to. This table should usually implement SupportsWrite. A new writer will be constructed via SupportsWrite.newWriteBuilder(LogicalWriteInfo), and the write will be committed. The job concludes with a call to commitStagedChanges(), at which point implementations are expected to commit the table's metadata into the metastore along with the data that was written by the writes from the write builder this table created.

  • Method Details

    • commitStagedChanges

      void commitStagedChanges()
      Finalize the creation or replacement of this table.
    • abortStagedChanges

      void abortStagedChanges()
      Abort the changes that were staged, both in metadata and from temporary outputs of this table's writers.