-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Hive: Metadata integrity check for encrypted tables #14685
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
|
@ggershinsky this is regarding our discussion at #13225 (comment) Let me know if you think this approach is right, then I'll work on the finishing touches and tests. |
|
Thanks @szlta , this approach looks good to me. |
hive-metastore/src/main/java/org/apache/iceberg/hive/HMSTablePropertyHelper.java
Outdated
Show resolved
Hide resolved
b170f1a to
9afe8ff
Compare
| public void close() throws IOException {} | ||
|
|
||
| public byte[] getHash() { | ||
| return digest.digest(); |
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.
nit: an exception if not closed?
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.
You're right, it's needed as calling digest() will cause a reset in MessageDigest internal state and further calls will produce a wrong value. I've added a closing logic now.
ggershinsky
left a comment
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.
Thanks @szlta !
Introducing new Hive table property metadata_hash (to be stored exclusively in HMS) that tracks the hash of the current table metadata. It is used in HiveTableOperations to carry out integrity check and ensure that the metadata.json has not been tampered with when table encryption is used.
Change-Id: I72dad6d8dbc2338299236e495bc76ba60fab7db8
Change-Id: Ie8d978b022ab67bfa3b3238ebc3c5d4f25d0a843
67b209e to
e614a79
Compare
|
cc @huaxingao |
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveTableOperations.java
Outdated
Show resolved
Hide resolved
Change-Id: Ie5a0310a1b2eb71ed171c1eaa4c4529ada136565
|
Thanks @szlta for the PR! Thanks @ggershinsky for the review! |
|
Thanks for review @ggershinsky and @huaxingao |
Introducing new Hive table property metadata_hash (to be stored exclusively in HMS) that tracks the hash of the current table metadata.
It is used in HiveTableOperations to carry out integrity check and ensure that the metadata.json has not been tampered with when table encryption is used.