@@ -140,6 +140,21 @@ class ICEBERG_EXPORT Catalog {
140140 const std::string& location,
141141 const std::unordered_map<std::string, std::string>& properties) = 0;
142142
143+ // / \brief Start a transaction to replace a table
144+ // /
145+ // / \param identifier a table identifier
146+ // / \param schema a schema
147+ // / \param spec a partition spec
148+ // / \param location a location for the table; leave empty if unspecified
149+ // / \param properties a string map of table properties
150+ // / \param orCreate whether to create the table if not exists
151+ // / \return a Transaction to replace the table or ErrorKind::kNotFound if the table
152+ // / doesn't exist and orCreate is false
153+ virtual Result<std::shared_ptr<Transaction>> StageReplaceTable (
154+ const TableIdentifier& identifier, const Schema& schema, const PartitionSpec& spec,
155+ const std::string& location,
156+ const std::unordered_map<std::string, std::string>& properties, bool orCreate) = 0;
157+
143158 // / \brief Check whether table exists
144159 // /
145160 // / \param identifier a table identifier
@@ -161,6 +176,15 @@ class ICEBERG_EXPORT Catalog {
161176 // / - On failure, contains error information.
162177 virtual Status DropTable (const TableIdentifier& identifier, bool purge) = 0;
163178
179+ // / \brief Rename a table
180+ // /
181+ // / \param from the current table identifier
182+ // / \param to the new table identifier
183+ // / \return Status indicating the outcome of the operation.
184+ // / - On success, the table was renamed.
185+ // / - On failure, contains error information.
186+ virtual Status RenameTable (const TableIdentifier& from, const TableIdentifier& to) = 0;
187+
164188 // / \brief Load a table
165189 // /
166190 // / \param identifier a table identifier
@@ -223,6 +247,16 @@ class ICEBERG_EXPORT Catalog {
223247 // /
224248 // / \return the Transaction to create the table
225249 virtual std::unique_ptr<Transaction> StageCreate () = 0;
250+
251+ // / \brief Starts a transaction to replace the table
252+ // /
253+ // / \return the Transaction to replace the table
254+ virtual std::unique_ptr<Transaction> StageReplace () = 0;
255+
256+ // / \brief Starts a transaction to create or replace the table
257+ // /
258+ // / \breturn the Transaction to create or replace the table
259+ virtual std::unique_ptr<Transaction> StageCreateOrReplace () = 0;
226260 };
227261
228262 // / \brief Instantiate a builder to either create a table or start a create/replace
0 commit comments