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

Add keyword in 144 #191

Merged
merged 6 commits into from
Aug 24, 2018
Merged

Add keyword in 144 #191

merged 6 commits into from
Aug 24, 2018

Conversation

Incarnation-p-lee
Copy link
Contributor

No description provided.

@codecov-io
Copy link

codecov-io commented Aug 23, 2018

Codecov Report

Merging #191 into master will decrease coverage by 0.2%.
The diff coverage is 71.42%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
.../spring/data/cosmosdb/core/query/CriteriaType.java 80% <100%> (+1.56%) ⬆️
...osmosdb/core/generator/AbstractQueryGenerator.java 83.82% <64.7%> (-6.38%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a596929...5b1511d. Read the comment docs.

@@ -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);
Copy link
Member

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?

Copy link
Contributor Author

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;
Copy link
Member

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 ?

Copy link
Contributor Author

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.

@Incarnation-p-lee Incarnation-p-lee merged commit c1dea70 into master Aug 24, 2018
@Incarnation-p-lee Incarnation-p-lee deleted the add-keyword-IN-144 branch August 24, 2018 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants