dttung2905 commented on code in PR #658:
URL: https://github.com/apache/iceberg-go/pull/658#discussion_r2644409033
##########
schema.go:
##########
@@ -809,8 +814,12 @@ type indexByName struct {
func (i *indexByName) ByID() map[int]string {
idToName := make(map[int]string)
- for k, v := range i.index {
- idToName[v] = k
+ for name, id := range i.index {
+ if existingName, ok := idToName[id]; ok && existingName != name
{
+ panic(fmt.Errorf("%w: multiple fields for id %d: %s and
%s",
+ ErrInvalidSchema, id, existingName, name))
+ }
+ idToName[id] = name
}
Review Comment:
Let me find another way to go around this . Are you saying we test it in the
addField() method? :thinking:
--
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]