yusufyildiz34 opened a new pull request, #18647:
URL: https://github.com/apache/iceberg/pull/18647

   `encryption-keys` is a v3 field, but 
`TableMetadata.Builder.addEncryptionKey` didn't check the format version, so 
Java clients and REST servers built on `CatalogHandlers` could write keys into 
v1/v2 metadata. This rejects `addEncryptionKey` below v3, the same way the 
builder rejects v3 types in schemas. An `upgrade-format-version` to v3 earlier 
in the same commit is still accepted. `removeEncryptionKey` and parsing are 
unchanged, so v1/v2 tables that already have keys still load and can drop them; 
commits that add keys to them now fail until they are upgraded. The other 
checks in #18646 are left for separate PRs.
   
   Closes #18632
   
   Test plan: adding a key fails on v1 and v2 with a message naming the key and 
both versions, and still works on v3 and later.
   
   ---
   **AI Disclosure**
   - Model: Claude Opus 5.5
   - Platform/Tool: Claude Code
   - Human Oversight: fully reviewed
   - Prompt Summary: Fix #18632 by rejecting encryption keys below v3 in 
TableMetadata.Builder, with tests
   


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