59 std::string table_name, std::shared_ptr<TransactionContext> ctx);
123 int64_t data_sequence_number);
145 const std::vector<std::shared_ptr<DataFile>>& files_to_delete,
146 const std::vector<std::shared_ptr<DataFile>>& files_to_add,
147 int64_t sequence_number);
158 const std::vector<std::shared_ptr<DataFile>>& data_files_to_replace,
159 const std::vector<std::shared_ptr<DataFile>>& delete_files_to_replace,
160 const std::vector<std::shared_ptr<DataFile>>& data_files_to_add,
161 const std::vector<std::shared_ptr<DataFile>>& delete_files_to_add);
177 const std::shared_ptr<Snapshot>& snapshot)
override;
179 explicit RewriteFiles(std::string table_name, std::shared_ptr<TransactionContext> ctx);
188 void ValidateReplacedAndAddedFiles();
194 std::optional<int64_t> starting_snapshot_id_;
A set of DataFile pointers with insertion order preserved and deduplicated by file path.
Definition data_file_set.h:44
Abstract base class for merge-based snapshot write operations.
Definition merging_snapshot_update.h:63
API for replacing files in a table.
Definition rewrite_files.h:51
RewriteFiles & SetDataSequenceNumber(int64_t sequence_number)
Configure the data sequence number for this rewrite operation.
RewriteFiles & ValidateFromSnapshot(int64_t snapshot_id)
Set the snapshot ID used in any reads for this operation.
RewriteFiles & AddDeleteFile(const std::shared_ptr< DataFile > &delete_file)
Add a new delete file.
static Result< std::unique_ptr< RewriteFiles > > Make(std::string table_name, std::shared_ptr< TransactionContext > ctx)
Create a new RewriteFiles operation.
std::string operation() override
A string that describes the action that produced the new snapshot.
RewriteFiles & AddDataFile(const std::shared_ptr< DataFile > &file)
Add a new data file.
RewriteFiles & RewriteDataFiles(const std::vector< std::shared_ptr< DataFile > > &files_to_delete, const std::vector< std::shared_ptr< DataFile > > &files_to_add, int64_t sequence_number)
Add a rewrite that replaces one set of data files with another set that contains the same data....
Status Validate(const TableMetadata ¤t_metadata, const std::shared_ptr< Snapshot > &snapshot) override
Validate the current metadata.
RewriteFiles & DeleteDataFile(const std::shared_ptr< DataFile > &data_file)
Remove a data file from the current table state.
RewriteFiles & DeleteDeleteFile(const std::shared_ptr< DataFile > &delete_file)
Remove a delete file from the table state.
RewriteFiles & Rewrite(const std::vector< std::shared_ptr< DataFile > > &data_files_to_replace, const std::vector< std::shared_ptr< DataFile > > &delete_files_to_replace, const std::vector< std::shared_ptr< DataFile > > &data_files_to_add, const std::vector< std::shared_ptr< DataFile > > &delete_files_to_add)
Add a rewrite that replaces one set of files with another set that contains the same data.
RewriteFiles & AddDeleteFile(const std::shared_ptr< DataFile > &delete_file, int64_t data_sequence_number)
Add a new delete file with the given data sequence number.
Define symbol visibility macros for core Iceberg APIs.
Core Apache Iceberg C++ APIs.
Definition arrow_io_util.h:33
std::expected< T, E > Result
Result alias.
Definition result.h:88
Define Result, Status, and error helpers.