Skip to content

Commit 4c3b27c

Browse files
committed
resolve comments
1 parent 0d3abb7 commit 4c3b27c

5 files changed

Lines changed: 7 additions & 25 deletions

File tree

src/iceberg/table.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,10 @@ Result<std::shared_ptr<FastAppend>> StaticTable::NewFastAppend() {
323323
return NotSupported("Cannot create a fast append for a static table");
324324
}
325325

326+
Result<std::shared_ptr<MergeAppend>> StaticTable::NewMergeAppend() {
327+
return NotSupported("Cannot create a merge append for a static table");
328+
}
329+
326330
Result<std::shared_ptr<SnapshotManager>> StaticTable::NewSnapshotManager() {
327331
return NotSupported("Cannot create a snapshot manager for a static table");
328332
}

src/iceberg/table.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ class ICEBERG_EXPORT StaticTable : public Table {
246246

247247
Result<std::shared_ptr<FastAppend>> NewFastAppend() override;
248248

249+
Result<std::shared_ptr<MergeAppend>> NewMergeAppend() override;
250+
249251
Result<std::shared_ptr<SnapshotManager>> NewSnapshotManager() override;
250252

251253
private:

src/iceberg/test/table_test.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ TEST(StaticTableTest, NewMutatingOperationsAreNotSupported) {
160160
EXPECT_THAT(table->NewUpdateStatistics(), IsError(ErrorKind::kNotSupported));
161161
EXPECT_THAT(table->NewUpdatePartitionStatistics(), IsError(ErrorKind::kNotSupported));
162162
EXPECT_THAT(table->NewFastAppend(), IsError(ErrorKind::kNotSupported));
163+
EXPECT_THAT(table->NewMergeAppend(), IsError(ErrorKind::kNotSupported));
163164
EXPECT_THAT(table->NewSnapshotManager(), IsError(ErrorKind::kNotSupported));
164165
}
165166

src/iceberg/update/snapshot_update.cc

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -399,29 +399,6 @@ Result<std::unordered_map<std::string, std::string>> SnapshotUpdate::ComputeSumm
399399
return summary;
400400
}
401401

402-
SnapshotSummaryBuilder SnapshotUpdate::BuildManifestCountSummary(
403-
std::span<const ManifestFile> manifests, int32_t replaced_manifests_count) {
404-
SnapshotSummaryBuilder summary;
405-
int32_t manifests_created = 0;
406-
int32_t manifests_kept = 0;
407-
int64_t snapshot_id = SnapshotId();
408-
409-
for (const auto& manifest : manifests) {
410-
if (manifest.added_snapshot_id == snapshot_id) {
411-
++manifests_created;
412-
} else if (manifest.added_snapshot_id != kInvalidSnapshotId) {
413-
++manifests_kept;
414-
}
415-
}
416-
417-
summary.Set(SnapshotSummaryFields::kManifestsCreated,
418-
std::to_string(manifests_created));
419-
summary.Set(SnapshotSummaryFields::kManifestsKept, std::to_string(manifests_kept));
420-
summary.Set(SnapshotSummaryFields::kManifestsReplaced,
421-
std::to_string(replaced_manifests_count));
422-
return summary;
423-
}
424-
425402
Status SnapshotUpdate::CleanAll() {
426403
for (const auto& manifest_list : manifest_lists_) {
427404
std::ignore = DeleteFile(manifest_list);

src/iceberg/update/snapshot_update.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,6 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate {
215215

216216
std::string ManifestPath();
217217
std::string ManifestListPath();
218-
SnapshotSummaryBuilder BuildManifestCountSummary(
219-
std::span<const ManifestFile> manifests, int32_t replaced_manifests_count);
220218
SnapshotSummaryBuilder& summary_builder() { return summary_; }
221219
SnapshotSummaryBuilder BuildManifestCountSummary(
222220
std::span<const ManifestFile> manifests, int32_t replaced_manifests_count);

0 commit comments

Comments
 (0)