smaheshwar-pltr commented on code in PR #18489:
URL: https://github.com/apache/iceberg/pull/18489#discussion_r4644289168


##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveTableOperations.java:
##########
@@ -213,22 +212,16 @@ the table key parameter (along with existing snapshots) 
in the file, making the
               ? Integer.parseInt(dekLengthFromHMS)
               : TableProperties.ENCRYPTION_DEK_LENGTH_DEFAULT;
 
-      encryptedKeys =
-          Optional.ofNullable(current().encryptionKeys())
-              .map(Lists::newLinkedList)
-              .orElseGet(Lists::newLinkedList);
-
-      // Active transactions may still need keys that are not in committed 
metadata.
-      if (encryptionManager != null) {
-        Set<String> keyIdsFromMetadata =
-            
encryptedKeys.stream().map(EncryptedKey::keyId).collect(Collectors.toSet());
-
-        for (EncryptedKey keyFromEM : 
EncryptionUtil.encryptionKeys(encryptionManager).values()) {
-          if (!keyIdsFromMetadata.contains(keyFromEM.keyId())) {
-            encryptedKeys.add(keyFromEM);
-          }
-        }
-      }
+      // Open transactions may still need keys that are not in committed 
metadata. After an
+      // earlier refresh discarded the manager, those keys are only in 
encryptedKeys.
+      Iterable<EncryptedKey> knownKeys =

Review Comment:
   I think these are all the keys this ops held before refresh so technically 
not only ones that open transactions need so to me `knownKeys` better conveys 
that



-- 
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]

Reply via email to