You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "tom-s-powell (via GitHub)" <gi...@apache.org> on 2026/06/18 09:13:57 UTC
[PR] Remove encryption key from keysById first to avoid removeIf [iceberg]
tom-s-powell opened a new pull request, #16860:
URL: https://github.com/apache/iceberg/pull/16860
https://github.com/apache/iceberg/blob/a165b1c1551dcdb215fb10a610f7d29edfa25df3/core/src/main/java/org/apache/iceberg/TableMetadata.java#L1018-L1020 and https://github.com/apache/iceberg/blob/a165b1c1551dcdb215fb10a610f7d29edfa25df3/core/src/main/java/org/apache/iceberg/TableMetadata.java#L1508 are guarding against multiple `EncryptedKey` with the same `key-id`.
As such it would be more efficient to remove `keyId` from `keysById` first, the result of which will determine whether the key exists or not. We can then use `encryptionKeys.remove` to remove the _first_ (and only) occurrence of `EncryptedKey` rather than `encryptionKeys.removeIf` which will iterate through the entire list of encryption keys unnecessarily even after removing the only occurrence.
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Core: Remove encryption key from keysById first to avoid removeIf [iceberg]
Posted by "singhpk234 (via GitHub)" <gi...@apache.org>.
singhpk234 commented on PR #16860:
URL: https://github.com/apache/iceberg/pull/16860#issuecomment-4793910616
Thanks for the change @tom-s-powell ! thanks for the review @smaheshwar-pltr @huaxingao
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Core: Remove encryption key from keysById first to avoid removeIf [iceberg]
Posted by "singhpk234 (via GitHub)" <gi...@apache.org>.
singhpk234 merged PR #16860:
URL: https://github.com/apache/iceberg/pull/16860
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Core: Remove encryption key from keysById first to avoid removeIf [iceberg]
Posted by "tom-s-powell (via GitHub)" <gi...@apache.org>.
tom-s-powell commented on PR #16860:
URL: https://github.com/apache/iceberg/pull/16860#issuecomment-4777491142
@huaxingao is this something you'd be happy reviewing?
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org