badalprasadsingh opened a new issue, #1689:
URL: https://github.com/apache/iceberg-go/issues/1689
### Apache Iceberg version
main (development)
### Please describe the bug 🐞
Right now, `SetIdentifierField` mutates `u.identifierFieldNames` immediately
when called, unlike all other builder methods (`AddColumn`, `RenameColumn`,
`DeleteColumn`, `UpdateColumn`, `MoveColumn`) which defer their work into
`u.ops` and are executed in call order during `Apply()`.
As a result, `SetIdentifierField` always takes effect before any deferred
operation regardless of where it appears in the chain, so chain order is not
honored.
For e.g.,
```go
NewUpdateSchema(txn, true, true).RenameColumn([]string{"id"},
"new_id").SetIdentifierField([[]string{{"id"}}).Apply()
```
should fail (as `id` is no longer existing after the rename). Instead it
silently succeeds and rewrites the identifier field to `new_id`. Eager mutation
also causes `initIdentifierFieldNames()` to skip seeding the current schema's
existing identifier fields.
#### What is expected?
Let `SetIdentifierField` participate in the same deferred, ordered execution
as every other builder method.
### Status
Working on this fix, would be submitting a PR for this.
--
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]