gty404 commented on code in PR #1034:
URL: https://github.com/apache/iceberg-cpp/pull/1034#discussion_r4320834854


##########
src/iceberg/manifest/manifest_reader.cc:
##########
@@ -465,9 +491,9 @@ Status ParseDataFile(const std::shared_ptr<StructType>& 
data_file_schema,
 
     switch (field_id) {
       case DataFile::kContentFieldId:
-        ICEBERG_RETURN_UNEXPECTED(ParseIntegerField(field_view, 
manifest_entries,
-                                                    
proj_data_file(&DataFile::content),
-                                                    field_name, required));
+        ICEBERG_RETURN_UNEXPECTED(
+            ParseEnumField(DataFileContentFromInt, field_view, 
manifest_entries,
+                           proj_data_file(&DataFile::content), field_name, 
required));

Review Comment:
   Good catch, thanks. Fixed in ea36a9c2: the `kFileFormatFieldId` loop now 
checks `required` and returns `MakeNullError` for a null value, same as the 
other fields in this switch. Added a regression test 
(`RejectsNullRequiredFileFormat`) that writes a null `file_format` via a 
relaxed write-side schema (bypassing the writer's own non-null enforcement) and 
asserts the reader rejects it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to