ggershinsky commented on code in PR #2639: URL: https://github.com/apache/iceberg/pull/2639#discussion_r1104620689
########## parquet/src/main/java/org/apache/iceberg/parquet/Parquet.java: ########## @@ -71,6 +72,7 @@ import org.apache.iceberg.deletes.EqualityDeleteWriter; import org.apache.iceberg.deletes.PositionDeleteWriter; import org.apache.iceberg.encryption.EncryptionKeyMetadata; +import org.apache.iceberg.encryption.envelope.EnvelopeKeyMetadata; Review Comment: > Can we move this class into encryption? Sure. > Why is it called "Envelope"? Isn't it just key metadata? This form of key metadata keeps the wrapped keys, and the ID of the wrapping key. But we are unlikely to need any other form of key metadata in the future. We can call this class simply "KeyMetadata" ########## parquet/src/main/java/org/apache/iceberg/parquet/Parquet.java: ########## @@ -231,6 +243,31 @@ private WriteBuilder createContextFunc( return this; } + private FileEncryptionProperties createEncryptionProperties(EncryptionKeyMetadata keyMetadata) { + Preconditions.checkArgument(keyMetadata != null, "Null key metadata"); + + // Native Parquet encryption can be activated only by envelope metadata. + // Other metadata types imply flat/generic file encryption + if (!(keyMetadata instanceof EnvelopeKeyMetadata)) { Review Comment: Sure. Per the comment above, I'm fine with having only this type of key metadata. ########## parquet/src/main/java/org/apache/iceberg/parquet/Parquet.java: ########## @@ -1000,6 +1042,21 @@ public ReadBuilder withNameMapping(NameMapping newNameMapping) { return this; } + public ReadBuilder withKeyMetadata(ByteBuffer encryptionKeyMetadata) { Review Comment: Per the discussion above, we'll have only one type of key metadata. So replacing ByteBuffer with that class should be fine. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org