Skip to content
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

Fix encrypt large value #15199

Merged
merged 2 commits into from
Sep 23, 2020
Merged

Conversation

rschlussel
Copy link
Contributor

Test plan - new unit test in AbstractTestOrcReader

== RELEASE NOTES ==
Hive Changes
* Fix a bug where DWRF encryption would fail for large uncompressed column values

@rschlussel rschlussel force-pushed the fix-encrypt-large-value branch from a7fe457 to ccca045 Compare September 21, 2020 19:40

Random rnd = new Random(0);
String val = rnd.doubles(50_000).mapToObj(Double::toString).collect(Collectors.joining(","));
tester.assertRoundTrip(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test doesn't use testRoundTrip() because there is some bug with the hive reader reading the list value test (unrelated to encryption)

length = chunk.length;
offset = 0;
// size after encryption should not exceed what the 3 byte header can hold (2^23)
if (length > 8388608) {
throw new OrcEncryptionException("Encrypted data size %s exceeds limit of 2^23 %s", length);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message has two %s placeholders, it should either have two length arguments or not have the last %s.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, thank you!

Copy link
Contributor

@mbasmanova mbasmanova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typos in the commit message:

  • "valuess" -> "values"
  • "datat" -> "data"

We were using the incorrect offsets for the data we were encrypting and
for the output buffer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants