2222#include < cassert>
2323#include < utility>
2424
25+ #include < iceberg/result.h>
26+
2527#include " iceberg/manifest_entry.h"
2628#include " iceberg/manifest_list.h"
2729#include " iceberg/snapshot.h"
@@ -41,18 +43,18 @@ Status BaseInheritableMetadata::Apply(ManifestEntry& entry) {
4143 entry.snapshot_id = snapshot_id_;
4244 }
4345
44- // In v1 tables , the data sequence number is not persisted and can be safely defaulted
46+ // In v1 metadata , the data sequence number is not persisted and can be safely defaulted
4547 // to 0.
46- // In v2 tables , the data sequence number should be inherited iff the entry status
48+ // In v2 metadata , the data sequence number should be inherited iff the entry status
4749 // is ADDED.
4850 if (!entry.sequence_number .has_value () &&
4951 (sequence_number_ == 0 || entry.status == ManifestStatus::kAdded )) {
5052 entry.sequence_number = sequence_number_;
5153 }
5254
53- // In v1 tables , the file sequence number is not persisted and can be safely defaulted
55+ // In v1 metadata , the file sequence number is not persisted and can be safely defaulted
5456 // to 0.
55- // In v2 tables , the file sequence number should be inherited iff the entry status
57+ // In v2 metadata , the file sequence number should be inherited iff the entry status
5658 // is ADDED.
5759 if (!entry.file_sequence_number .has_value () &&
5860 (sequence_number_ == 0 || entry.status == ManifestStatus::kAdded )) {
@@ -61,6 +63,8 @@ Status BaseInheritableMetadata::Apply(ManifestEntry& entry) {
6163
6264 if (entry.data_file ) {
6365 entry.data_file ->partition_spec_id = spec_id_;
66+ } else {
67+ return InvalidManifest (" Manifest entry has no data file" );
6468 }
6569
6670 return {};
0 commit comments