File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -574,7 +574,7 @@ Result<std::vector<ManifestFile>> ManifestListReaderImpl::Files() const {
574574}
575575
576576Result<ManifestFileField> ManifestFileFieldFromIndex (int32_t index) {
577- if (index >= 0 && index < static_cast <int32_t >(ManifestFileField::kNextId )) {
577+ if (index >= 0 && index < static_cast <int32_t >(ManifestFileField::kNextUnusedId )) {
578578 return static_cast <ManifestFileField>(index);
579579 }
580580 return InvalidArgument (" Invalid manifest file field index: {}" , index);
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ class ManifestListReaderImpl : public ManifestListReader {
6262
6363enum class ManifestFileField : int32_t {
6464 kManifestPath = 0 ,
65- kManifestLength ,
65+ kManifestLength = 1 ,
6666 kPartitionSpecId = 2 ,
6767 kContent = 3 ,
6868 kSequenceNumber = 4 ,
@@ -77,7 +77,9 @@ enum class ManifestFileField : int32_t {
7777 kPartitionFieldSummary = 13 ,
7878 kKeyMetadata = 14 ,
7979 kFirstRowId = 15 ,
80- kNextId = 16 ,
80+ // kNextUnusedId is the placeholder for the next unused index.
81+ // Always keep this as the last index when adding new fields.
82+ kNextUnusedId = 16 ,
8183};
8284
8385Result<ManifestFileField> ManifestFileFieldFromIndex (int32_t index);
Original file line number Diff line number Diff line change @@ -149,14 +149,14 @@ Result<Scalar> ManifestFileStructLike::GetField(size_t pos) const {
149149 return manifest_file.first_row_id .value ();
150150 }
151151 return {};
152- case ManifestFileField::kNextId :
152+ case ManifestFileField::kNextUnusedId :
153153 return InvalidArgument (" Invalid manifest file field index: {}" , pos);
154154 }
155155 return InvalidArgument (" Invalid manifest file field index: {}" , pos);
156156}
157157
158158size_t ManifestFileStructLike::num_fields () const {
159- return static_cast <size_t >(ManifestFileField::kNextId );
159+ return static_cast <size_t >(ManifestFileField::kNextUnusedId );
160160}
161161
162162std::unique_ptr<StructLike> FromManifestFile (const ManifestFile& file) {
You can’t perform that action at this time.
0 commit comments