-
Notifications
You must be signed in to change notification settings - Fork 1k
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: Pull Query Key Extraction Optimizations #8346
Conversation
@@ -577,6 +582,34 @@ private Object resolveKey( | |||
FormatOptions.noEscape()))) | |||
.orElse(null); | |||
} | |||
|
|||
private void getConstraint( |
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.
This method name is a bit vague and sounds like a getter. Maybe call it setMostSelectiveConstraint
or something like that? It would also be good to add a comment about what this does.
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.
Done
assertThat(keys.size(), is(1)); | ||
assertThat(keys.get(0), instanceOf(KeyConstraint.class)); | ||
final KeyConstraint keyConstraint = (KeyConstraint) keys.get(0); | ||
assertThat(keyConstraint.getKey(), is(GenericKey.genericKey(3))); |
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.
Want to check the operator to show that you have the equals as well? Finding a three probably indicates that the one you got, but good to be sure.
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.
Done
assertThat(keys.size(), is(1)); | ||
assertThat(keys.get(0), instanceOf(KeyConstraint.class)); | ||
final KeyConstraint keyConstraint = (KeyConstraint) keys.get(0); | ||
assertThat(keyConstraint.getKey(), is(GenericKey.genericKey("v2"))); |
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 great to check the operator here and elsewhere too just to be sure we didn't accidentally swap them with other key values.
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.
Done
Description
Optimize the key constraint extraction logic.
This problem was reported in issue #6973
Testing done
Add new unit tests.
Reviewer checklist