Skip to content

Commit 310fae7

Browse files
committed
fix: move Set to SnapshotUpdate
1 parent 004a162 commit 310fae7

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

src/iceberg/update/fast_append.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,6 @@ FastAppend& FastAppend::ToBranch(const std::string& branch) {
9393
return *this;
9494
}
9595

96-
FastAppend& FastAppend::Set(const std::string& property, const std::string& value) {
97-
summary_.Set(property, value);
98-
return *this;
99-
}
100-
10196
std::string FastAppend::operation() { return DataOperation::kAppend; }
10297

10398
Result<std::vector<ManifestFile>> FastAppend::Apply(

src/iceberg/update/fast_append.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,6 @@ class ICEBERG_EXPORT FastAppend : public SnapshotUpdate {
7575
/// \return Reference to this for method chaining
7676
FastAppend& ToBranch(const std::string& branch);
7777

78-
/// \brief Set a summary property.
79-
///
80-
/// \param property The property name
81-
/// \param value The property value
82-
/// \return Reference to this for method chaining
83-
FastAppend& Set(const std::string& property, const std::string& value);
84-
8578
std::string operation() override;
8679

8780
Result<std::vector<ManifestFile>> Apply(
@@ -110,7 +103,6 @@ class ICEBERG_EXPORT FastAppend : public SnapshotUpdate {
110103

111104
private:
112105
std::string table_name_;
113-
SnapshotSummaryBuilder summary_;
114106
std::unordered_map<int32_t, DataFileSet> new_data_files_by_spec_;
115107
std::vector<ManifestFile> append_manifests_;
116108
std::vector<ManifestFile> rewritten_append_manifests_;

src/iceberg/update/snapshot_update.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,16 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate {
7676
return self;
7777
}
7878

79+
/// \brief Set a summary property.
80+
///
81+
/// \param property The property name
82+
/// \param value The property value
83+
/// \return Reference to this for method chaining
84+
auto& Set(this auto& self, const std::string& property, const std::string& value) {
85+
self.summary_.Set(property, value);
86+
return self;
87+
}
88+
7989
/// \brief Apply the update's changes to create a new snapshot.
8090
///
8191
/// This method validates the changes, applies them to the metadata,
@@ -179,6 +189,10 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate {
179189

180190
std::string ManifestPath();
181191

192+
protected:
193+
/// \brief Builder for tracking snapshot summary properties and metrics.
194+
SnapshotSummaryBuilder summary_;
195+
182196
private:
183197
/// \brief Returns the snapshot summary from the implementation and updates totals.
184198
Result<std::unordered_map<std::string, std::string>> ComputeSummary(

0 commit comments

Comments
 (0)