manuzhang commented on code in PR #1104:
URL: https://github.com/apache/iceberg-cpp/pull/1104#discussion_r4613308699
##########
src/iceberg/transaction.cc:
##########
@@ -534,7 +621,40 @@ void Transaction::CleanupUpdates() noexcept {
}
void Transaction::FinalizeUpdates(const TableMetadata& committed) noexcept {
+ std::optional<std::unordered_set<std::string>> committed_files;
+ internal::LogAndIgnoreFailure("Transaction file discovery", [&]() -> Status {
+ std::unordered_set<int64_t> snapshot_ids;
+ for (const auto& change : ctx_->metadata_builder->changes()) {
+ if (change->kind() == TableUpdate::Kind::kAddSnapshot) {
+ const auto& snapshot =
+ internal::checked_cast<const
table::AddSnapshot&>(*change).snapshot();
+ snapshot_ids.insert(snapshot->snapshot_id);
+ }
+ }
+ std::unordered_set<std::string> content_paths;
+ for (const auto& update : pending_updates_) {
+ if (update->kind() != PendingUpdate::Kind::kUpdateSnapshot) {
Review Comment:
nit: wrap the following blocks in `if (update->kind() ==
PendingUpdate::Kind::kUpdateSnapshot)` and remove unnecessary `continue`.
--
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]