-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add keyword in 144 #191
Add keyword in 144 #191
Conversation
Signed-off-by: Pan Li <panli@microsoft.com>
Signed-off-by: Pan Li <panli@microsoft.com>
Signed-off-by: Pan Li <panli@microsoft.com>
Signed-off-by: Pan Li <panli@microsoft.com>
Codecov Report
@@ Coverage Diff @@
## master #191 +/- ##
==========================================
- Coverage 80.76% 80.56% -0.21%
==========================================
Files 39 39
Lines 936 957 +21
Branches 118 123 +5
==========================================
+ Hits 756 771 +15
- Misses 122 125 +3
- Partials 58 61 +3
Continue to review full report at Codecov.
|
@@ -55,7 +55,12 @@ private boolean isCrossPartitionQuery(@NonNull String keyName) { | |||
|
|||
final Optional<Criteria> criteria = this.getSubjectCriteria(this.criteria, keyName); | |||
|
|||
return criteria.map(criteria1 -> criteria1.getType() == CriteriaType.IS_EQUAL).orElse(true); | |||
return criteria.map(criteria1 -> criteria1.getType() != CriteriaType.IS_EQUAL).orElse(true); |
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.
For case isEqual and other condition, seems the result is opposite? e.g., findByNameAndAgeGreaterThan
, will return true
, but actually should be false
?
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.
typo from last PR, should be !=
here. Yes, the result is opposite. If not equal and OR keyword, should enable CrossPartitionKey.
|
||
private boolean hasKeywordOr() { | ||
// If there is OR keyword in DocumentQuery, the top node of Criteria must be OR type. | ||
return this.criteria.getType() == CriteriaType.OR; |
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.
Why not need to check the subCriteria
inside the criteria
?
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.
Actually, here we check is there any OR keyword in criteria. Any OR keyword will make the semantic to query cross ParititonKey.
Signed-off-by: Pan Li <panli@microsoft.com>
1d8ecfa
to
5b1511d
Compare
No description provided.