WZhuo opened a new pull request, #1145:
URL: https://github.com/apache/iceberg-cpp/pull/1145

   Closes #1141.
   
   The spec requires a field of type `unknown` to be optional and forbids an 
`unknown` map key. `Schema::Validate(format_version)` already checked this 
through `ValidateFieldNullability`, but only table metadata parsing and 
`UpdateSchema` call `Validate`. `SchemaFromJson` and other `Schema::Make` 
callers accepted such schemas.
   
   This runs the nullability check in both `Schema::Make` overloads. The rule 
does not depend on the format version, so `Make` is a natural place for it, and 
Java does the same check when it constructs a `NestedField`. `Validate` keeps 
the check for schemas built with the constructor directly.
   
   Tests:
   - `SchemaTest.MakeRejectsRequiredUnknownField` covers both `Make` overloads.
   - `SchemaJsonTest.RejectsRequiredUnknownFields` covers `SchemaFromJson` with 
a required top-level field, a required nested field, a required list element, 
and an unknown map key.
   
   The iceberg-verification case `schema/unknown/reject-unknown-required` 
(#1144) passes with this change. `rest_catalog_test` has 3 auth failures 
locally that also occur on unmodified main. All other tests and pre-commit pass.
   


-- 
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