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


##########
schema.go:
##########
@@ -86,6 +86,11 @@ func (s *Schema) init() {
        s.lazyNameMapping = sync.OnceValue(func() NameMapping {
                return createMappingFromSchema(s)
        })
+
+       // Validate that the schema does not contain duplicate field IDs.
+       if _, err := IndexNameByID(s); err != nil {
+               panic(err)
+       }

Review Comment:
   I think we should not have runtime panics that can be caused by user error, 
we should make the schema init fallible instead and return an err



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