zeroshade commented on code in PR #2585:
URL: https://github.com/apache/iceberg-go/pull/2585#discussion_r4645341576


##########
view/metadata_builder.go:
##########
@@ -246,6 +252,41 @@ func (b *MetadataBuilder) addSchema(schema 
*iceberg.Schema) (int, error) {
        return newSchemaID, nil
 }
 
+// checkUniqueFieldIDs returns an error if two fields share an ID, walking
+// struct, list and map children. Unlike NewSchema, it also checks 0 and
+// negative IDs.
+func checkUniqueFieldIDs(seen map[int]string, fields []iceberg.NestedField) 
error {

Review Comment:
   nit, fine as a follow-up: this is a line-for-line copy of 
`checkUniqueFieldIDs` in `table/metadata_schema_compatibility.go`, and the root 
package's `checkFieldIDs(..., true)` is a third version of the same walk. 
`table/internal` isn't importable from `view`, but a small helper under the 
top-level `internal/` could be shared by `table` and `view`.



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