wgtmac commented on code in PR #429:
URL: https://github.com/apache/iceberg-cpp/pull/429#discussion_r2639096199
##########
src/iceberg/test/update_properties_test.cc:
##########
@@ -28,11 +27,6 @@ namespace iceberg {
class UpdatePropertiesTest : public UpdateTestBase {};
-TEST_F(UpdatePropertiesTest, EmptyUpdates) {
Review Comment:
Why this gets removed? It should be a valid case.
##########
src/iceberg/update/update_properties.cc:
##########
@@ -92,21 +103,29 @@ Result<PendingUpdate::ApplyResult>
UpdateProperties::Apply() {
}
format_version_ = static_cast<int8_t>(parsed_version);
- updates_.erase(iter);
+ updates_.erase(TableProperties::kFormatVersion.key());
}
if (auto schema = transaction_->current().Schema(); schema.has_value()) {
ICEBERG_RETURN_UNEXPECTED(
- MetricsConfig::VerifyReferencedColumns(updates_, *schema.value()));
+ MetricsConfig::VerifyReferencedColumns(new_properties,
*schema.value()));
}
ApplyResult result;
if (!updates_.empty()) {
result.updates.emplace_back(std::make_unique<table::SetProperties>(updates_));
}
if (!removals_.empty()) {
- result.updates.emplace_back(std::make_unique<table::RemoveProperties>(
- std::vector<std::string>{removals_.begin(), removals_.end()}));
+ std::vector<std::string> existing_removals;
Review Comment:
I think you can build `existing_removals` inside the for loop at line 77.
Perhaps `existing_removals` can be simply renamed to `removals` for short.
##########
src/iceberg/update/update_properties.cc:
##########
@@ -92,21 +103,29 @@ Result<PendingUpdate::ApplyResult>
UpdateProperties::Apply() {
}
format_version_ = static_cast<int8_t>(parsed_version);
- updates_.erase(iter);
+ updates_.erase(TableProperties::kFormatVersion.key());
Review Comment:
Please revert this line since the original implementation does not search
the same key again.
--
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]