xanderbailey opened a new pull request, #3659: URL: https://github.com/apache/iceberg-rust/pull/3659
## Which issue does this PR close? - Part of #3402. ## What changes are included in this PR? `EncryptionManager::from_table_metadata` returned `Ok(None)` for v1/v2 tables before it read `encryption.key-id`, so commits to a pre-v3 table with that property wrote plaintext manifest lists and manifests without error. It now returns `DataInvalid` (`Invalid properties for v2: encryption.key-id`), matching iceberg-python's `EncryptionManager.from_table_metadata`. Pre-v3 tables without the property are unaffected. Because `Table::build` creates the manager eagerly, the error surfaces when a table is loaded or created, not on first encrypted read/write: - Catalogs write and register metadata before building the `Table`, so `create_table` on a v2 table with `encryption.key-id` registers the table and then returns the error. Rejecting the property at creation and in `SetProperties` (as iceberg-python #4173 and Java's `EncryptionUtil.checkCompatibility` do) would close this; happy to add it here or in a follow-up. - An existing v2 table with the property can no longer be loaded by iceberg-rust, so it has to be repaired with another client. - `TableMetadataBuilder::add_encryption_key` on v1/v2 metadata is not addressed. ## Are these changes tested? Yes. `table_builder_skips_encryption_on_pre_v3_table` is replaced by `table_builder_rejects_encryption_key_id_on_pre_v3_table`, which asserts the error for v1 and v2 metadata. ## AI Disclosure Written with Claude Code. Worth a reviewer's attention: whether failing eagerly in `Table::build` (rather than lazily, as iceberg-python does) is acceptable given the load/create consequences above, and the choice of `DataInvalid` over `FeatureUnsupported`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
