shangxinli commented on code in PR #281:
URL: https://github.com/apache/iceberg-cpp/pull/281#discussion_r2484177969
##########
src/iceberg/catalog.h:
##########
@@ -223,6 +247,16 @@ class ICEBERG_EXPORT Catalog {
///
/// \return the Transaction to create the table
virtual std::unique_ptr<Transaction> StageCreate() = 0;
+
+ /// \brief Starts a transaction to replace the table
+ ///
+ /// \return the Transaction to replace the table
+ virtual std::unique_ptr<Transaction> StageReplace() = 0;
+
+ /// \brief Starts a transaction to create or replace the table
+ ///
+ /// \breturn the Transaction to create or replace the table
Review Comment:
typo? '\return'?
##########
src/iceberg/table.h:
##########
@@ -109,6 +109,11 @@ class ICEBERG_EXPORT Table {
/// filter data.
virtual std::unique_ptr<TableScanBuilder> NewScan() const;
+ /// \brief Create a new transaction for this table
+ ///
+ /// \return a shared pointer to the new Transaction
+ virtual std::shared_ptr<Transaction> NewTransaction();
Review Comment:
We don't want to add 'const' just like NewScan() and io()?
##########
src/iceberg/transaction.h:
##########
@@ -42,12 +44,23 @@ class ICEBERG_EXPORT Transaction {
/// \return a new AppendFiles
virtual std::shared_ptr<AppendFiles> NewAppend() = 0;
+ /// \brief Apply multiple metadata updates to this transaction
+ ///
+ /// \param requirements the table requirements to validate
+ /// \param updates the table updates to apply
+ /// \return Status::OK if all updates were queued successfully
+ virtual Status UpdateTable(
+ const std::vector<std::unique_ptr<TableRequirement>>& requirements,
+ std::vector<std::unique_ptr<TableUpdate>> updates) = 0;
+
/// \brief Apply the pending changes from all actions and commit
///
- /// May throw ValidationException if any update cannot be applied to the
current table
- /// metadata. May throw CommitFailedException if the updates cannot be
committed due to
- /// conflicts.
- virtual void CommitTransaction() = 0;
Review Comment:
Do we want to keep backward compatibility with deprecation e.g.
[[deprecated("Use CommitTransaction() that returns Status")]]
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]