-
Notifications
You must be signed in to change notification settings - Fork 2.6k
API, Core: Add table metadata keys for encryption #12927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* | ||
* @return a string key ID | ||
*/ | ||
default String keyId() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to name this encryptionKeyId
as keyId
might not be immediately obvious that it relates to encryption when browsing/reading the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't we call this encryptingKeyId in the spec proposal?
NVM we have this one as key-id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that this is unclear and needs to be longer, but I'm open to making it encryptionKeyId
if others think that it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to change it unless we change it in the spec as well
core/src/main/java/org/apache/iceberg/RewriteTablePathUtil.java
Outdated
Show resolved
Hide resolved
@@ -201,6 +201,14 @@ public static ByteBuffer getByteBufferOrNull(String property, JsonNode node) { | |||
BaseEncoding.base16().decode(pNode.textValue().toUpperCase(Locale.ROOT))); | |||
} | |||
|
|||
public static Map<String, String> getStringMapOrNull(String property, JsonNode node) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be good to test these new methods in TestJsonUtil
e09c590
to
cc162e8
Compare
Updated for review comments and to add tests that I didn't add in the initial push. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes LGTM, I think we're only missing some tests for the new changes added in JsonUtil
Thanks for reviewing, @nastra and @RussellSpitzer! |
This implements the spec changes from #12162.
It adds the
encryption-keys
list toTableMetadata
that stores anEncryptedKey
. TheTableMetadata.Builder
is updated withaddEncryptionKey
andremoveEncryptionKey
methods, along with corresponding REST protocol metadata updates. This also addskey-id
to snapshot metadata.