feat(encryption) [2/N] Support encryption: Add Table Properties for Encryption Configuration #2030
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pat of #2034
This PR introduces table-level encryption properties to enable configuration of encryption settings for Iceberg tables. These properties lay the groundwork for future encryption implementation while maintaining compatibility with the Java implementation's property names and structure.
Table-level encryption is a critical security feature in Apache Iceberg's Java implementation. To support encryption in iceberg-rust and ensure interoperability between Java and Rust implementations, we need to start by adding the configuration properties that control encryption behavior. This PR adds the property definitions and parsing logic without implementing the actual encryption, keeping the change focused and reviewable.
Modified:
crates/iceberg/src/spec/table_properties.rsAdded encryption-related properties to the
TablePropertiesstruct:PROPERTY_ENCRYPTION_KEY_ID("encryption.key-id") - Master key ID for encrypting data encryption keysPROPERTY_ENCRYPTION_DEK_LENGTH("encryption.data-key-length") - Data encryption key length (default: 16 bytes)All
Option<T>as encryption is optional:encryption_key_id: Option<String>encryption_dek_length: Option<usize>Extended
TryFrom<&HashMap<String, String>>implementation to parse encryption propertiesProperty names match exactly with Java's implementation:
TableProperties.ENCRYPTION_TABLE_KEY→ Rust:PROPERTY_ENCRYPTION_KEY_IDTableProperties.ENCRYPTION_DEK_LENGTH→ Rust:PROPERTY_ENCRYPTION_DEK_LENGTHAdded comprehensive test coverage:
test_table_properties_default: Verifies encryption properties are None by defaulttest_encryption_properties_valid: Tests parsing all encryption properties with valid valuestest_encryption_properties_partial: Tests partial encryption configurationtest_encryption_properties_invalid_numeric: Verifies invalid numeric values are handled gracefully (parsed as None)test_encryption_properties_with_other_properties: Tests encryption properties alongside existing table propertiesOptional Fields: All encryption properties are
Option<T>since encryption is an optional featureSilent Failure for Invalid Numbers: Invalid numeric values for
dek_lengthare parsed asNonerather than failing, matching the pattern for optional propertiesNo Validation: This PR doesn't validate property values (e.g., valid key lengths), leaving that for the encryption implementation
Independent PR: No dependencies on other encryption code, can be merged independently
This PR is part of a series to implement encryption support:
Which issue does this PR close?
What changes are included in this PR?
Are these changes tested?