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 @@ -568,7 +568,7 @@ Result<std::vector<ManifestFile>> ManifestListReaderImpl::Files() const {
568568}
569569
570570Result<ManifestFileField> ManifestFileFieldFromIndex (int32_t index) {
571- if (index >= 0 && index < static_cast <int32_t >(ManifestFileField::kNextId )) {
571+ if (index >= 0 && index < static_cast <int32_t >(ManifestFileField::kNextUnusedId )) {
572572 return static_cast <ManifestFileField>(index);
573573 }
574574 return InvalidArgument (" Invalid manifest file field index: {}" , index);
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ class ManifestListReaderImpl : public ManifestListReader {
5656
5757enum class ManifestFileField : int32_t {
5858 kManifestPath = 0 ,
59- kManifestLength ,
59+ kManifestLength = 1 ,
6060 kPartitionSpecId = 2 ,
6161 kContent = 3 ,
6262 kSequenceNumber = 4 ,
@@ -71,7 +71,9 @@ enum class ManifestFileField : int32_t {
7171 kPartitionFieldSummary = 13 ,
7272 kKeyMetadata = 14 ,
7373 kFirstRowId = 15 ,
74- kNextId = 16 ,
74+ // kNextUnusedId is the placeholder for the next unused index.
75+ // Always keep this as the last index when adding new fields.
76+ kNextUnusedId = 16 ,
7577};
7678
7779Result<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