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

   Fixes #18632.
   
   `encryption-keys` is a v3 field, but 
`TableMetadata.Builder.addEncryptionKey` didn't check the format version, so a 
REST server built on `CatalogHandlers` would write `add-encryption-key` into 
v1/v2 metadata. This rejects it in the builder, which covers both Java clients 
and REST servers.
   
   `removeEncryptionKey` and parsing stay lenient, as the issue suggests, so a 
v1/v2 table that already picked up keys can still be cleaned up. 
`SnapshotProducer` only adds keys when the table has encryption properties, and 
those are already rejected below v3 at table creation 
(`testEncryptionVersionValidation`), so normal commits are unaffected.
   
   This picks up #18647 by @yusufyildiz34, which was closed as stale, and 
applies @singhpk234's review suggestions from there: the constant sits next to 
`MIN_FORMAT_VERSION_ROW_LINEAGE`, and the message reads "encryption is 
supported for v3 and above". The one suggestion not applied is a check in 
`removeEncryptionKey`: removal has to keep working on v1/v2 for that cleanup 
case.
   
   Tests: `testAddEncryptionKeyRejectedBeforeV3` (v1, v2) and 
`testAddEncryptionKeyFromV3` (v3 and above). `TestTableMetadata`, 
`TestMetadataUpdateParser` and the `encryption` tests pass.


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