3333
3434namespace iceberg {
3535
36- // / \brief The type of files tracked by the manifest, either data or delete files; 0 for
37- // / all v1 manifests
38- enum class ManifestContent {
39- // / The manifest content is data.
40- kData = 0 ,
41- // / The manifest content is deletes.
42- kDeletes = 1 ,
43- };
44-
45- // / \brief Get the relative manifest content type name
46- ICEBERG_EXPORT constexpr std::string_view ManifestContentToString (
47- ManifestContent type) noexcept {
48- switch (type) {
49- case ManifestContent::kData :
50- return " data" ;
51- case ManifestContent::kDeletes :
52- return " deletes" ;
53- }
54- }
55-
56- // / \brief Get the relative manifest content type from name
57- ICEBERG_EXPORT constexpr Result<ManifestContent> ManifestContentFromString (
58- std::string_view str) noexcept {
59- if (str == " data" ) return ManifestContent::kData ;
60- if (str == " deletes" ) return ManifestContent::kDeletes ;
61- return InvalidArgument (" Invalid manifest content type: {}" , str);
62- }
63-
6436// / \brief Field summary for partition field in the spec.
6537// /
6638// / Each field of this corresponds to a field in the manifest file's partition spec.
@@ -98,6 +70,15 @@ struct ICEBERG_EXPORT PartitionFieldSummary {
9870
9971// / \brief Entry in a manifest list.
10072struct ICEBERG_EXPORT ManifestFile {
73+ // / \brief The type of files tracked by the manifest, either data or delete files; 0 for
74+ // / all v1 manifests
75+ enum class Content {
76+ // / The manifest content is data.
77+ kData = 0 ,
78+ // / The manifest content is deletes.
79+ kDeletes = 1 ,
80+ };
81+
10182 // / Field id: 500
10283 // / Location of the manifest file
10384 std::string manifest_path;
@@ -111,7 +92,7 @@ struct ICEBERG_EXPORT ManifestFile {
11192 // / Field id: 517
11293 // / The type of files tracked by the manifest, either data or delete files; 0 for all v1
11394 // / manifests
114- ManifestContent content;
95+ Content content;
11596 // / Field id: 515
11697 // / The sequence number when the manifest was added to the table; use 0 when reading v1
11798 // / manifest lists
@@ -232,4 +213,22 @@ struct ICEBERG_EXPORT ManifestList {
232213 std::vector<ManifestFile> entries;
233214};
234215
216+ // / \brief Get the relative manifest content type name
217+ ICEBERG_EXPORT constexpr std::string_view ToString (ManifestFile::Content type) noexcept {
218+ switch (type) {
219+ case ManifestFile::Content::kData :
220+ return " data" ;
221+ case ManifestFile::Content::kDeletes :
222+ return " deletes" ;
223+ }
224+ }
225+
226+ // / \brief Get the relative manifest content type from name
227+ ICEBERG_EXPORT constexpr Result<ManifestFile::Content> ManifestFileContentFromString (
228+ std::string_view str) noexcept {
229+ if (str == " data" ) return ManifestFile::Content::kData ;
230+ if (str == " deletes" ) return ManifestFile::Content::kDeletes ;
231+ return InvalidArgument (" Invalid manifest content type: {}" , str);
232+ }
233+
235234} // namespace iceberg
0 commit comments