twuebi commented on code in PR #605:
URL: https://github.com/apache/iceberg-go/pull/605#discussion_r2465139877


##########
schema.go:
##########
@@ -79,6 +79,11 @@ func NewSchemaWithIdentifiers(id int, identifierIDs []int, 
fields ...NestedField
 }
 
 func (s *Schema) init() {
+       // Validate unknown type requirements
+       if err := s.validateUnknownTypes(); err != nil {
+               panic(fmt.Sprintf("Invalid schema: %v", err))
+       }

Review Comment:
   We have some schema validations in `checkSchemaCompatibility`, maybe you can 
fit it in there.
   
   Eventually, we should bite the bullet and make the schema constructor 
fallible. While it's going to cascade and cause a lot of breakage, it'll give 
us a much safer type where we know that if it exists, it's in a valid 
configuration.



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