rdblue commented on code in PR #6762:
URL: https://github.com/apache/iceberg/pull/6762#discussion_r1421846390
##########
parquet/src/main/java/org/apache/iceberg/parquet/Parquet.java:
##########
@@ -125,6 +127,16 @@ public static WriteBuilder write(OutputFile file) {
return new WriteBuilder(file);
}
+ public static WriteBuilder write(EncryptedOutputFile file) {
+ if (EncryptionUtil.useNativeEncryption(file.keyMetadata())) {
+ return write(file.rawOutputFile())
+ .withFileEncryptionKey(file.keyMetadata().encryptionKey())
Review Comment:
I think I suggested adding `encryptionKey` and `aadPrefix` to the base, but
after looking at the `castOrParse`, I think it would be cleaner to use that
here to get an instance of `StandardKeyMetadata`.
It may also be simpler if this used a direct `instanceof` check here. Then
you could just cast directly. You can't do that with a method that may change
doing the type check.
```java
if (file.keyMetadata() instanceof StandardKeyMetadata) {
StandardKeyMetadata keyMetadata = (StandardKeyMetadata) file.keyMetadata();
return write(file.plainOutputFile())
.withFileEncryptionKey(keyMetadata.encryptionKey())
.withAADPrefix(keyMetadata.aadPrefix())
} else {
return write(file.encryptingOutputFile());
}
```
--
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]