Shruthirdy opened a new pull request, #2737:
URL: https://github.com/apache/iceberg-go/pull/2737
Closes #2734.
`table` and `view` each had their own copy of the check that rejects
duplicate
field IDs, including 0 and negatives (`view`'s was added in #2585 because it
couldn't reach the unexported `table` helper). This moves it into a new
`internal/fieldids` package that both use, as suggested in the #2585 review.
### Change
- New `internal/fieldids.CheckUnique`, the same walk over struct, list and
map
children.
- `table.validateUniqueFieldIDs` and the view builder's `addSchema` call it;
both copies are removed.
- It's a new package rather than part of `internal` itself, because the root
package imports `internal` and the helper needs `iceberg.NestedField`.
`internal/` keeps it out of the public API.
- The root package keeps its own `checkFieldIDs` for `Schema.UnmarshalJSON`,
since it can't import a package that imports it.
No behaviour change.
### Tests
`TestCheckUnique` takes over the cases from table's
`TestValidateUniqueFieldIDs`
and adds map keys, nested structs, nil types and an empty list. The table,
view
and SQL catalog tests are unchanged, and fail if either caller stops using
the
check.
--
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]