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 {
574
574
}
575
575
576
576
Result<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 )) {
578
578
return static_cast <ManifestFileField>(index);
579
579
}
580
580
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 {
62
62
63
63
enum class ManifestFileField : int32_t {
64
64
kManifestPath = 0 ,
65
- kManifestLength ,
65
+ kManifestLength = 1 ,
66
66
kPartitionSpecId = 2 ,
67
67
kContent = 3 ,
68
68
kSequenceNumber = 4 ,
@@ -77,7 +77,9 @@ enum class ManifestFileField : int32_t {
77
77
kPartitionFieldSummary = 13 ,
78
78
kKeyMetadata = 14 ,
79
79
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 ,
81
83
};
82
84
83
85
Result<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 {
149
149
return manifest_file.first_row_id .value ();
150
150
}
151
151
return {};
152
- case ManifestFileField::kNextId :
152
+ case ManifestFileField::kNextUnusedId :
153
153
return InvalidArgument (" Invalid manifest file field index: {}" , pos);
154
154
}
155
155
return InvalidArgument (" Invalid manifest file field index: {}" , pos);
156
156
}
157
157
158
158
size_t ManifestFileStructLike::num_fields () const {
159
- return static_cast <size_t >(ManifestFileField::kNextId );
159
+ return static_cast <size_t >(ManifestFileField::kNextUnusedId );
160
160
}
161
161
162
162
std::unique_ptr<StructLike> FromManifestFile (const ManifestFile& file) {
You can’t perform that action at this time.
0 commit comments