Repository navigation
fix(store): dedup LIMIT_DEDUP index elements by id - #3451
Open
ShryukGrandhi wants to merge 1 commit into
Open
ShryukGrandhi wants to merge 1 commit into
ShryukGrandhi wants to merge 1 commit into
Conversation
Signed-off-by: ShryukGrandhi <85529990+ShryukGrandhi@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3451 +/- ##
=========================================
Coverage 58.42% 58.42%
- Complexity 6903 6905 +2
=========================================
Files 779 779
Lines 69391 69391
Branches 9567 9567
=========================================
Hits 40539 40539
- Misses 25179 25181 +2
+ Partials 3673 3671 -2
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of the PR
In
BusinessHandlerImpl.scanIndex(...), thetransElementbranch wrapsscanIndexToBaseElementinMapLimitIteratorforLIMIT_DEDUP.MapLimitIteratordedups on the elements themselves, butBaseVertexandBaseElementdon't defineequals/hashCode, so two vertex objects with the same id both get through.DEDUPandPRECISE_DEDUPon the same branch already dedup by id.The path isn't reachable yet (
index2Elementthrows andloadPropertyFromIndexis always false), but once it is, any index that writes several entries per element (search, collection secondary, joint secondary) would return the same vertex more than once.Main Changes
MapLimitIteratorgets a second constructor that takes a key extractor; the existing constructor usesFunction.identity(), so theBackendColumncallers behave as before.LIMIT_DEDUPcase on thetransElementpath passesBaseElement::id.BaseVertexequality is left alone, since changing it would affect every collection that holds vertices.Verifying these changes
MapLimitIteratorTest(added toCoreSuiteTest) feeds two freshBaseVertexobjects per id throughMapLimitIterator. Before the change it emitted 20 elements for 10 ids; now it emits 10.FilterIteratorColumnEqualityTest,FilterIteratorContractTest,ProjectionStageTest,UnionFilterIteratorTestandFilterIteratorCleanupTeststill pass.Does this PR potentially affect the following parts?
Documentation Status
Doc - TODO: required documentation is pending; complete it before merging.Doc - Done: documentation is included here or linked below.Doc - No Need: no user-visible documentation is affected.