-
Notifications
You must be signed in to change notification settings - Fork 273
feat: [iceberg] Pass table master key ID to native scan #3229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3229 +/- ##
============================================
+ Coverage 56.12% 60.04% +3.92%
- Complexity 976 1429 +453
============================================
Files 119 170 +51
Lines 11743 15779 +4036
Branches 2251 2607 +356
============================================
+ Hits 6591 9475 +2884
- Misses 4012 4982 +970
- Partials 1140 1322 +182 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
andygrove
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Feedback
Thanks for working on Parquet Modular Encryption support for Iceberg! I found an issue with the current implementation.
Missing Protobuf Serialization
The tableMasterKey is extracted from Iceberg table properties in IcebergReflection.scala and stored in CometIcebergNativeScanMetadata, but it's never serialized to protobuf.
Looking at the data flow:
| Step | File | Status |
|---|---|---|
| 1. Protobuf field | operator.proto |
✅ Added optional string table_master_key = 13 |
| 2. Rust struct field | iceberg_scan.rs |
✅ Added table_master_key: Option<String> |
| 3. Rust planner | planner.rs |
✅ Reads scan.table_master_key.clone() |
| 4. Scala extraction | IcebergReflection.scala |
✅ Extracts encryption.key-id into metadata |
| 5. Scala serialization | CometIcebergNativeScan.scala |
❌ Missing |
The serde file CometIcebergNativeScan.scala needs to serialize the key to protobuf. Something like:
// In the convert() method, after building other fields:
metadata.tableMasterKey.foreach { key =>
icebergScanBuilder.setTableMasterKey(key)
}Without this, the key extracted in step 4 never reaches the Rust side.
Other Notes
- The
#[allow(dead_code)]annotation and TODO comment in Rust are fine since this is infrastructure for future work - Consider adding a simple test to verify the key is correctly passed through the serde layer, even if encryption isn't fully implemented yet
This review was generated with AI assistance.
| } | ||
|
|
||
| // tableMasterKey is optional | ||
| val tableMasterKey = getTableProperties(table).flatMap { properties => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make it so that we only call getTableProperties once and get all of the fields we want to avoid reflection overhead?
Which issue does this PR close?
Related to #. #2921
Rationale for this change
encryption.kms-impland the other table-level propertyencryption.key-id.What changes are included in this PR?
encryption.key-id, to native scan so that we can pass to Iceberg Rust reader for KMS management.How are these changes tested?