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

Improve verification for map columns #14054

Merged
merged 1 commit into from
Feb 18, 2020

Conversation

brendan-driscoll
Copy link
Contributor

@brendan-driscoll brendan-driscoll commented Feb 3, 2020

Part of #13809

== RELEASE NOTES ==

Verifier Changes
* Add checks for keys, values, and cardinality sum when validating a map column.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 3, 2020

CLA Check
The committers are authorized under a signed CLA.

  • ✅ brendan-driscoll (a80129143eb365ef0d5c8a8111dd625d629927a0)

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.

@brendan-driscoll Thanks for working on this. Looks good % a question.

Let's remove "Initial commit:" from the commit message and PR title.

@caithagoras Would you take a look?

@brendan-driscoll brendan-driscoll changed the title Initial commit: add verification mismatch info for map columns Add verification mismatch info for map columns Feb 4, 2020
@caithagoras
Copy link
Contributor

Apologize for the delay. I'll get it reviewed by tomorrow morning.

Copy link
Contributor

@caithagoras caithagoras left a comment

Choose a reason for hiding this comment

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

Take a look at QueryUtil.functionCall to simplify all callers for new FunctionCall

@caithagoras
Copy link
Contributor

Potentially, if key/values types are of other non-simple types, we'll be able to apply the respective column validator on the keys and values (with some restrictions).
Depends on #14036

@caithagoras
Copy link
Contributor

@brendan-driscoll Please squash the 2 commits.

@caithagoras
Copy link
Contributor

The PR is missing tests. Please take a look at TestChecksumValidator

@@ -297,9 +304,9 @@ public void testArray()
ChecksumResult controlChecksum = new ChecksumResult(
5,
ImmutableMap.<String, Object>builder()
.put("int_array_checksum", new SqlVarbinary(new byte[] {0xa}))
.put("int_array_checksum", new SqlVarbinary(new byte[]{0xa}))
Copy link
Contributor

Choose a reason for hiding this comment

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

Your formatting is off. Please follow 7e and 7f in https://our.internmc.facebook.com/intern/wiki/DataInfra/Presto/Source/
to install Airlift code style, and then format the file with (option + cmd + L).

Comment on lines 427 to 428
.put(MAP_COLUMN, new ColumnMatchResult(false, "control(checksum: 0a, keys_checksum: 0b, values_checksum: 0c, cardinality_sum: 3) " +
"test(checksum: 1a, keys_checksum: 0b, values_checksum: 0c, cardinality_sum: 3)"))
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: all arguments on the same line, or one argument per line. Same below.

@caithagoras
Copy link
Contributor

caithagoras commented Feb 5, 2020

@brendan-driscoll
Copy link
Contributor Author

brendan-driscoll commented Feb 6, 2020

== RELEASE NOTES ==

Verifier Changes
* Add checks for keys, values, and cardinality sum when validating a map column.

@mbasmanova
Copy link
Contributor

@brendan-driscoll Would you please squash commits?

@viczhang861
Copy link
Contributor

@brendan-driscoll Why is this a fix for #3809 ?

@mbasmanova
Copy link
Contributor

@brendan-driscoll Thanks for squashing commits. Please, update the commit to match the guidelines at https://chris.beams.io/posts/git-commit/

For example,

Improve verification for map columns

Add checksums for map key, values and map sizes.

@caithagoras
Copy link
Contributor

Please update the commit title and the PR title.

@brendan-driscoll
Copy link
Contributor Author

brendan-driscoll commented Feb 7, 2020

@brendan-driscoll Why is this a fix for #3809 ?

@viczhang861 That was a typo, should have been #13809

@brendan-driscoll brendan-driscoll changed the title Add verification mismatch info for map columns Improve verification for map columns Feb 7, 2020
@mbasmanova
Copy link
Contributor

@brendan-driscoll There are some merge conflicts. Would you rebase on top of latest master and update the PR?

@brendan-driscoll brendan-driscoll force-pushed the verify-map-columns branch 2 times, most recently from 2cbe269 to 1022df1 Compare February 10, 2020 16:24
@mbasmanova
Copy link
Contributor

@brendan-driscoll Test failures seem to be related to the changes. Would you take a look?

Copy link
Contributor

@caithagoras caithagoras left a comment

Choose a reason for hiding this comment

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

lgtm % nit
please also fix Travis test

Add checksums for map key, values and map sizes.
@caithagoras caithagoras merged commit 6e24976 into prestodb:master Feb 18, 2020
@caithagoras caithagoras mentioned this pull request Mar 5, 2020
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants