gaborkaszab commented on code in PR #17984:
URL: https://github.com/apache/iceberg/pull/17984#discussion_r4034420394
##########
core/src/main/java/org/apache/iceberg/ManifestListWriter.java:
##########
@@ -94,14 +99,25 @@ public Long nextRowId() {
}
public ManifestListFile toManifestListFile() {
- if (manifestListKeyMetadata != null &&
manifestListKeyMetadata.encryptionKey() != null) {
- String manifestListKeyID =
- standardEncryptionManager.addManifestListKeyMetadata(
- manifestListKeyMetadata.copyWithLength(writer.length()));
- return new BaseManifestListFile(outputFile.location(),
manifestListKeyID);
- } else {
- return new BaseManifestListFile(outputFile.location(), null);
+ Preconditions.checkState(closed, "Cannot build ManifestListFile, writer is
not closed");
+ if (manifestListFile == null) {
Review Comment:
I know this has been merged due to the urgency of the release. However, I'm
a bit confused here, because the role of `manifestListFile` in this class is
not clear to me. We introduced it within this PR, but for me its only purpose
seems to be an indication whether we have to run `registerKeyMetadata` or not.
We could have introduced a boolean instead, or even used `encryptionKeys ==
null` if I don't miss anything.
WDYT @smaheshwar-pltr @amogh-jahagirdar ?
--
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]