twuebi commented on issue #538:
URL: https://github.com/apache/iceberg-go/issues/538#issuecomment-3213356593
Let me try and reproduce the issue, the current `AddSchema` function does a
max between old and newSchema:
```go
func (b *MetadataBuilder) AddSchema(schema *iceberg.Schema)
(*MetadataBuilder, error) {
newSchemaID := b.reuseOrCreateNewSchemaID(schema)
if _, err := b.GetSchemaByID(newSchemaID); err == nil {
if b.lastAddedSchemaID == nil || *b.lastAddedSchemaID !=
newSchemaID {
b.updates = append(b.updates,
NewAddSchemaUpdate(schema))
b.lastAddedSchemaID = &newSchemaID
}
return b, nil
}
b.lastColumnId = max(b.lastColumnId, schema.HighestFieldID())
schema.ID = newSchemaID
b.schemaList = append(b.schemaList, schema)
b.updates = append(b.updates, NewAddSchemaUpdate(schema))
b.lastAddedSchemaID = &newSchemaID
return b, nil
}
```
--
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]