amogh-jahagirdar commented on code in PR #15911:
URL: https://github.com/apache/iceberg/pull/15911#discussion_r3268258152
##########
core/src/main/java/org/apache/iceberg/deletes/BaseDVFileWriter.java:
##########
@@ -166,8 +180,23 @@ private void write(PuffinWriter writer, Deletes deletes) {
}
private PuffinWriter newWriter() {
- OutputFile outputFile = dvOutputFile.get();
- return
Puffin.write(outputFile).createdBy(IcebergBuild.fullVersion()).build();
+ EncryptedOutputFile outputFile = dvOutputFile.get();
+ this.keyMetadata = outputFile.keyMetadata();
+ return Puffin.write(outputFile.encryptingOutputFile())
+ .createdBy(IcebergBuild.fullVersion())
+ .build();
+ }
+
+ private ByteBuffer keyMetadata(long fileSizeInBytes) {
+ if (keyMetadata != null) {
Review Comment:
Do we need the null check at this level in the abstraction? It's always set
in newWriter() anyways.
Feel like:
```
private ByteBuffer keyMetadata(long fileSizeInBytes) {
if (keyMetadata instanceof NativeEncryptionKeyMetadata) {
return ((NativeEncryptionKeyMetadata)
keyMetadata).copyWithLength(fileSizeInBytes).buffer();
}
return keyMetadata.buffer();
}
```
should be all that's needed but let me know if i'm missing something
--
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]