wgtmac commented on code in PR #490:
URL: https://github.com/apache/iceberg-cpp/pull/490#discussion_r2664142657
##########
src/iceberg/table_metadata.cc:
##########
@@ -1077,6 +1083,79 @@ int32_t
TableMetadataBuilder::Impl::ReuseOrCreateNewSchemaId(
return new_schema_id;
}
+Status TableMetadataBuilder::Impl::SetRef(const std::string& name,
+ std::shared_ptr<SnapshotRef> ref) {
+ ICEBERG_PRECHECK(!metadata_.refs.contains(name),
+ "Cannot set ref: {}, which is already exist.", name);
+ metadata_.refs[name] = ref;
+ if (ref->type() == SnapshotRefType::kBranch) {
+ auto retention = std::get<SnapshotRef::Branch>(ref->retention);
+ changes_.push_back(std::make_unique<table::SetSnapshotRef>(
+ name, ref->snapshot_id, ref->type(), retention.min_snapshots_to_keep,
+ retention.max_snapshot_age_ms, retention.max_ref_age_ms));
+ } else {
+ auto retention = std::get<SnapshotRef::Tag>(ref->retention);
+ changes_.push_back(std::make_unique<table::SetSnapshotRef>(
+ name, ref->snapshot_id, ref->type(), std::nullopt, std::nullopt,
+ retention.max_ref_age_ms));
+ }
+ return {};
+}
+
+Status TableMetadataBuilder::Impl::RemoveRef(const std::string& name) {
Review Comment:
This does not align with the Java impl:
```java
public Builder removeRef(String name) {
if (SnapshotRef.MAIN_BRANCH.equals(name)) {
this.currentSnapshotId = -1;
}
SnapshotRef ref = refs.remove(name);
if (ref != null) {
changes.add(new MetadataUpdate.RemoveSnapshotRef(name));
}
return this;
}
```
##########
src/iceberg/table_metadata.cc:
##########
@@ -1077,6 +1083,79 @@ int32_t
TableMetadataBuilder::Impl::ReuseOrCreateNewSchemaId(
return new_schema_id;
}
+Status TableMetadataBuilder::Impl::SetRef(const std::string& name,
+ std::shared_ptr<SnapshotRef> ref) {
+ ICEBERG_PRECHECK(!metadata_.refs.contains(name),
+ "Cannot set ref: {}, which is already exist.", name);
+ metadata_.refs[name] = ref;
+ if (ref->type() == SnapshotRefType::kBranch) {
+ auto retention = std::get<SnapshotRef::Branch>(ref->retention);
+ changes_.push_back(std::make_unique<table::SetSnapshotRef>(
+ name, ref->snapshot_id, ref->type(), retention.min_snapshots_to_keep,
+ retention.max_snapshot_age_ms, retention.max_ref_age_ms));
+ } else {
+ auto retention = std::get<SnapshotRef::Tag>(ref->retention);
+ changes_.push_back(std::make_unique<table::SetSnapshotRef>(
+ name, ref->snapshot_id, ref->type(), std::nullopt, std::nullopt,
+ retention.max_ref_age_ms));
+ }
+ return {};
+}
+
+Status TableMetadataBuilder::Impl::RemoveRef(const std::string& name) {
+ ICEBERG_PRECHECK(metadata_.refs.contains(name),
+ "Cannot remove ref: {}, which is not exist.", name);
+
+ metadata_.refs.erase(name);
+ changes_.push_back(std::make_unique<table::RemoveSnapshotRef>(name));
+
+ return {};
+}
+
+Status TableMetadataBuilder::Impl::AddSnapshot(std::shared_ptr<Snapshot>
snapshot) {
+ // TODO(xiao.dong) this is only for test, not official complete
implementation
+ metadata_.snapshots.emplace_back(std::move(snapshot));
+ return {};
+}
+
+Status TableMetadataBuilder::Impl::RemoveSnapshots(
Review Comment:
This does not align with the Java imp either.
##########
src/iceberg/update/pending_update.h:
##########
@@ -46,6 +46,7 @@ class ICEBERG_EXPORT PendingUpdate : public ErrorCollector {
kUpdateProperties,
kUpdateSchema,
kUpdateSortOrder,
+ kExpireSnapshots,
Review Comment:
Sort it alphabetically
##########
src/iceberg/update/expire_snapshots.h:
##########
@@ -0,0 +1,175 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <cstdint>
+#include <functional>
+#include <memory>
+#include <unordered_set>
+#include <vector>
+
+#include "iceberg/iceberg_export.h"
+#include "iceberg/result.h"
+#include "iceberg/type_fwd.h"
+#include "iceberg/update/pending_update.h"
+#include "iceberg/util/timepoint.h"
+
+/// \file iceberg/update/expire_snapshots.h
+/// \brief API for removing old snapshots from a table.
+
+namespace iceberg {
+
+/// \brief An enum representing possible clean up levels used in snapshot
expiration.
+enum class CleanupLevel : uint8_t {
+ /// Skip all file cleanup, only remove snapshot metadata.
+ kNone,
+ /// Clean up only metadata files (manifests, manifest lists, statistics),
retain data
+ /// files.
+ kMetadataOnly,
+ /// Clean up both metadata and data files (default).
+ kAll
+};
+
+/// \brief API for removing old snapshots from a table.
+///
+/// This API accumulates snapshot deletions and commits the new list to the
table. This
+/// API does not allow deleting the current snapshot.
+///
+/// When committing, these changes will be applied to the latest table
metadata. Commit
+/// conflicts will be resolved by applying the changes to the new latest
metadata and
+/// reattempting the commit.
+///
+/// Manifest files that are no longer used by valid snapshots will be deleted.
Data files
+/// that were deleted by snapshots that are expired will be deleted.
DeleteWith() can be
+/// used to pass an alternative deletion method.
+///
+/// Apply() returns a list of the snapshots that will be removed.
+class ICEBERG_EXPORT ExpireSnapshots : public PendingUpdate {
+ public:
+ static Result<std::shared_ptr<ExpireSnapshots>> Make(
+ std::shared_ptr<Transaction> transaction);
+
+ ~ExpireSnapshots() override;
+
+ using SnapshotToRef = std::unordered_map<std::string,
std::shared_ptr<SnapshotRef>>;
+
+ struct ExpireSnapshotsResult {
+ SnapshotToRef ref_to_remove;
+ std::vector<int64_t> snapshot_ids_to_remove;
+ std::vector<int32_t> partition_spec_to_remove;
+ std::unordered_set<int32_t> schema_to_remove;
+ };
+
+ /// \brief Expires a specific Snapshot identified by id.
+ ///
+ /// \param snapshot_id Long id of the snapshot to expire.
+ /// \return Reference to this for method chaining.
+ ExpireSnapshots& ExpireSnapshotId(int64_t snapshot_id);
+
+ /// \brief Expires all snapshots older than the given timestamp.
+ ///
+ /// \param timestamp_millis A long timestamp in milliseconds.
+ /// \return Reference to this for method chaining.
+ ExpireSnapshots& ExpireOlderThan(int64_t timestamp_millis);
+
+ /// \brief Retains the most recent ancestors of the current snapshot.
+ ///
+ /// If a snapshot would be expired because it is older than the expiration
timestamp,
+ /// but is one of the num_snapshots most recent ancestors of the current
state, it will
+ /// be retained. This will not cause snapshots explicitly identified by id
from
+ /// expiring.
+ ///
+ /// This may keep more than num_snapshots ancestors if snapshots are added
concurrently.
+ /// This may keep less than num_snapshots ancestors if the current table
state does not
+ /// have that many.
+ ///
+ /// \param num_snapshots The number of snapshots to retain.
+ /// \return Reference to this for method chaining.
+ ExpireSnapshots& RetainLast(int num_snapshots);
+
+ /// \brief Passes an alternative delete implementation that will be used for
manifests
+ /// and data files.
+ ///
+ /// Manifest files that are no longer used by valid snapshots will be
deleted. Data
+ /// files that were deleted by snapshots that are expired will be deleted.
+ ///
+ /// If this method is not called, unnecessary manifests and data files will
still be
+ /// deleted.
+ ///
+ /// \param delete_func A function that will be called to delete manifests
and data files
+ /// \return Reference to this for method chaining.
+ ExpireSnapshots& DeleteWith(std::function<void(const std::string&)>
delete_func);
+
+ /// \brief Configures the cleanup level for expired files.
+ ///
+ /// This method provides fine-grained control over which files are cleaned
up during
+ /// snapshot expiration.
+ ///
+ /// Consider CleanupLevel::kMetadataOnly when data files are shared across
tables or
+ /// when using procedures like add-files that may reference the same data
files.
+ ///
+ /// Consider CleanupLevel::kNone when data and metadata files may be more
efficiently
+ /// removed using a distributed framework through the actions API.
+ ///
+ /// \param level The cleanup level to use for expired snapshots.
+ /// \return Reference to this for method chaining.
+ ExpireSnapshots& CleanupLevel(enum CleanupLevel level);
+
+ /// \brief Enable cleaning up unused metadata, such as partition specs,
schemas, etc.
+ ///
+ /// \param clean Remove unused partition specs, schemas, or other metadata
when true.
+ /// \return Reference to this for method chaining.
+ ExpireSnapshots& CleanExpiredMetadata(bool clean);
+
+ Kind kind() const final { return Kind::kExpireSnapshots; }
+
+ /// \brief Apply the pending changes and return the results
+ /// \return The results of changes
+ Result<ExpireSnapshotsResult> Apply();
+
+ Status Commit() override;
+
+ private:
+ explicit ExpireSnapshots([[maybe_unused]] std::shared_ptr<Transaction>
transaction);
+
+ Result<std::vector<int64_t>> ComputeBranchSnapshotsToRetain(
+ const Table& table, int64_t snapshot, int64_t expire_snapshot_older_than,
+ int32_t min_snapshots_to_keep);
+
+ Result<std::vector<int64_t>> ComputeAllBranchSnapshotIds(
+ const Table& table, const SnapshotToRef& retained_refs);
+
+ Result<std::vector<int64_t>> UnreferencedSnapshotIds(
+ const Table& table, const TableMetadata& current_metadata,
+ const SnapshotToRef& retained_refs);
+
+ private:
+ // Internal state
Review Comment:
```suggestion
```
##########
src/iceberg/table_metadata.cc:
##########
@@ -1077,6 +1083,79 @@ int32_t
TableMetadataBuilder::Impl::ReuseOrCreateNewSchemaId(
return new_schema_id;
}
+Status TableMetadataBuilder::Impl::SetRef(const std::string& name,
Review Comment:
https://github.com/apache/iceberg-cpp/pull/408 is adding `SetRef` and
`AddSnapshot`. Perhaps we should wait for it to be merged and leave them as not
implemented for now?
##########
src/iceberg/test/expire_snapshots_test.cc:
##########
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "iceberg/update/expire_snapshots.h"
+
+#include "iceberg/test/matchers.h"
+#include "iceberg/test/update_test_base.h"
+
+namespace iceberg {
+
+class ExpireSnapshotsTest : public UpdateTestBase {
+ protected:
+};
+
+TEST_F(ExpireSnapshotsTest, Empty) {
+ ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots());
+ ICEBERG_UNWRAP_OR_FAIL(auto result, update->Apply());
+ EXPECT_THAT(result.snapshot_ids_to_remove.size(), 1);
+ EXPECT_THAT(result.snapshot_ids_to_remove.at(0), 3051729675574597004);
+ EXPECT_THAT(result.ref_to_remove.empty(), true);
Review Comment:
```suggestion
EXPECT_TRUE(result.ref_to_remove.empty());
```
##########
src/iceberg/test/expire_snapshots_test.cc:
##########
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "iceberg/update/expire_snapshots.h"
+
+#include "iceberg/test/matchers.h"
+#include "iceberg/test/update_test_base.h"
+
+namespace iceberg {
+
+class ExpireSnapshotsTest : public UpdateTestBase {
+ protected:
Review Comment:
```suggestion
```
##########
src/iceberg/update/expire_snapshots.h:
##########
@@ -0,0 +1,175 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <cstdint>
+#include <functional>
+#include <memory>
+#include <unordered_set>
+#include <vector>
+
+#include "iceberg/iceberg_export.h"
+#include "iceberg/result.h"
+#include "iceberg/type_fwd.h"
+#include "iceberg/update/pending_update.h"
+#include "iceberg/util/timepoint.h"
+
+/// \file iceberg/update/expire_snapshots.h
+/// \brief API for removing old snapshots from a table.
+
+namespace iceberg {
+
+/// \brief An enum representing possible clean up levels used in snapshot
expiration.
+enum class CleanupLevel : uint8_t {
+ /// Skip all file cleanup, only remove snapshot metadata.
+ kNone,
+ /// Clean up only metadata files (manifests, manifest lists, statistics),
retain data
+ /// files.
+ kMetadataOnly,
+ /// Clean up both metadata and data files (default).
+ kAll
+};
+
+/// \brief API for removing old snapshots from a table.
+///
+/// This API accumulates snapshot deletions and commits the new list to the
table. This
+/// API does not allow deleting the current snapshot.
+///
+/// When committing, these changes will be applied to the latest table
metadata. Commit
+/// conflicts will be resolved by applying the changes to the new latest
metadata and
+/// reattempting the commit.
+///
+/// Manifest files that are no longer used by valid snapshots will be deleted.
Data files
+/// that were deleted by snapshots that are expired will be deleted.
DeleteWith() can be
+/// used to pass an alternative deletion method.
+///
+/// Apply() returns a list of the snapshots that will be removed.
+class ICEBERG_EXPORT ExpireSnapshots : public PendingUpdate {
+ public:
+ static Result<std::shared_ptr<ExpireSnapshots>> Make(
+ std::shared_ptr<Transaction> transaction);
+
+ ~ExpireSnapshots() override;
+
+ using SnapshotToRef = std::unordered_map<std::string,
std::shared_ptr<SnapshotRef>>;
+
+ struct ExpireSnapshotsResult {
+ SnapshotToRef ref_to_remove;
+ std::vector<int64_t> snapshot_ids_to_remove;
+ std::vector<int32_t> partition_spec_to_remove;
+ std::unordered_set<int32_t> schema_to_remove;
+ };
+
+ /// \brief Expires a specific Snapshot identified by id.
+ ///
+ /// \param snapshot_id Long id of the snapshot to expire.
+ /// \return Reference to this for method chaining.
+ ExpireSnapshots& ExpireSnapshotId(int64_t snapshot_id);
+
+ /// \brief Expires all snapshots older than the given timestamp.
+ ///
+ /// \param timestamp_millis A long timestamp in milliseconds.
+ /// \return Reference to this for method chaining.
+ ExpireSnapshots& ExpireOlderThan(int64_t timestamp_millis);
+
+ /// \brief Retains the most recent ancestors of the current snapshot.
+ ///
+ /// If a snapshot would be expired because it is older than the expiration
timestamp,
+ /// but is one of the num_snapshots most recent ancestors of the current
state, it will
+ /// be retained. This will not cause snapshots explicitly identified by id
from
+ /// expiring.
+ ///
+ /// This may keep more than num_snapshots ancestors if snapshots are added
concurrently.
+ /// This may keep less than num_snapshots ancestors if the current table
state does not
+ /// have that many.
+ ///
+ /// \param num_snapshots The number of snapshots to retain.
+ /// \return Reference to this for method chaining.
+ ExpireSnapshots& RetainLast(int num_snapshots);
Review Comment:
```suggestion
ExpireSnapshots& RetainLast(int32_t num_snapshots);
```
##########
src/iceberg/update/expire_snapshots.h:
##########
@@ -0,0 +1,175 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <cstdint>
+#include <functional>
+#include <memory>
+#include <unordered_set>
+#include <vector>
+
+#include "iceberg/iceberg_export.h"
+#include "iceberg/result.h"
+#include "iceberg/type_fwd.h"
+#include "iceberg/update/pending_update.h"
+#include "iceberg/util/timepoint.h"
+
+/// \file iceberg/update/expire_snapshots.h
+/// \brief API for removing old snapshots from a table.
+
+namespace iceberg {
+
+/// \brief An enum representing possible clean up levels used in snapshot
expiration.
+enum class CleanupLevel : uint8_t {
+ /// Skip all file cleanup, only remove snapshot metadata.
+ kNone,
+ /// Clean up only metadata files (manifests, manifest lists, statistics),
retain data
+ /// files.
+ kMetadataOnly,
+ /// Clean up both metadata and data files (default).
+ kAll
+};
+
+/// \brief API for removing old snapshots from a table.
+///
+/// This API accumulates snapshot deletions and commits the new list to the
table. This
+/// API does not allow deleting the current snapshot.
+///
+/// When committing, these changes will be applied to the latest table
metadata. Commit
+/// conflicts will be resolved by applying the changes to the new latest
metadata and
+/// reattempting the commit.
+///
+/// Manifest files that are no longer used by valid snapshots will be deleted.
Data files
+/// that were deleted by snapshots that are expired will be deleted.
DeleteWith() can be
+/// used to pass an alternative deletion method.
+///
+/// Apply() returns a list of the snapshots that will be removed.
+class ICEBERG_EXPORT ExpireSnapshots : public PendingUpdate {
+ public:
+ static Result<std::shared_ptr<ExpireSnapshots>> Make(
+ std::shared_ptr<Transaction> transaction);
+
+ ~ExpireSnapshots() override;
+
+ using SnapshotToRef = std::unordered_map<std::string,
std::shared_ptr<SnapshotRef>>;
+
+ struct ExpireSnapshotsResult {
+ SnapshotToRef ref_to_remove;
+ std::vector<int64_t> snapshot_ids_to_remove;
+ std::vector<int32_t> partition_spec_to_remove;
+ std::unordered_set<int32_t> schema_to_remove;
Review Comment:
```suggestion
std::vector<int32_t> partition_spec_ids_to_remove;
std::unordered_set<int32_t> schema_ids_to_remove;
```
##########
src/iceberg/test/expire_snapshots_test.cc:
##########
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "iceberg/update/expire_snapshots.h"
+
+#include "iceberg/test/matchers.h"
+#include "iceberg/test/update_test_base.h"
+
+namespace iceberg {
+
+class ExpireSnapshotsTest : public UpdateTestBase {
+ protected:
+};
+
+TEST_F(ExpireSnapshotsTest, Empty) {
+ ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots());
+ ICEBERG_UNWRAP_OR_FAIL(auto result, update->Apply());
+ EXPECT_THAT(result.snapshot_ids_to_remove.size(), 1);
Review Comment:
```suggestion
EXPECT_EQ(result.snapshot_ids_to_remove.size(), 1);
```
##########
src/iceberg/type_fwd.h:
##########
@@ -192,6 +192,7 @@ class UpdatePartitionSpec;
class UpdateProperties;
class UpdateSchema;
class UpdateSortOrder;
+class ExpireSnapshots;
Review Comment:
Sort alphabetically.
##########
src/iceberg/test/expire_snapshots_test.cc:
##########
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "iceberg/update/expire_snapshots.h"
+
+#include "iceberg/test/matchers.h"
+#include "iceberg/test/update_test_base.h"
+
+namespace iceberg {
+
+class ExpireSnapshotsTest : public UpdateTestBase {
+ protected:
+};
+
+TEST_F(ExpireSnapshotsTest, Empty) {
+ ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots());
+ ICEBERG_UNWRAP_OR_FAIL(auto result, update->Apply());
+ EXPECT_THAT(result.snapshot_ids_to_remove.size(), 1);
+ EXPECT_THAT(result.snapshot_ids_to_remove.at(0), 3051729675574597004);
+ EXPECT_THAT(result.ref_to_remove.empty(), true);
Review Comment:
Same for other boolean test.
--
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]