Repository navigation
test(store): cover the id-only projection through QueryUtil.buildPlan - #3410
Conversation
The existing tests drive ProjectionStage by hand, so they would miss a change in how buildPlan wires the projection for a null_property request. The new case checks that buildPlan returns a projection-only plan for that request, feeds MapLimitIterator output through it, and checks each key comes out once with an empty value. It fails with "key 0 emitted twice" when the ProjectionStage fix from apache#3408 is reverted.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3410 +/- ##
============================================
+ Coverage 57.27% 57.28% +0.01%
+ Complexity 6577 2395 -4182
============================================
Files 776 776
Lines 68881 68876 -5
Branches 9431 9431
============================================
+ Hits 39449 39454 +5
+ Misses 25804 25793 -11
- Partials 3628 3629 +1
*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:
|
bitflicker64
left a comment
There was a problem hiding this comment.
Blocking: no. Score: 9/10. Summary: The new case builds the plan through QueryUtil.buildPlan for an id-only request and fails if the projection is dropped, initialized without removeAllProperty, or mutates the column in place; ServerSuiteTest picks it up and the store-server-test CI run reports 183 tests passing.
imbajin
left a comment
There was a problem hiding this comment.
Blocking: no. Summary: The regression test exercises the id-only QueryUtil.buildPlan path and detects missing projection, incorrect property removal and mutation that breaks limit deduplication. Evidence: Three independent static reviews traced the plan, iterator hash semantics and ServerSuiteTest inclusion; exact-revision Store and HStore CI passed. No local Maven run was repeated. Score: 8.8/10.
Purpose of the PR
The tests in #3408 call
ProjectionStagedirectly, so they would still pass ifQueryUtil.buildPlanstopped adding the projection for anull_propertyrequest or initialized it withoutremoveAllProperty. This adds one case that runsMapLimitIteratoroutput through the plan the server builds, checking that id-only rows come back with an empty value and that the limit dedup still drops repeated keys on that path.Main Changes
ProjectionStageTest.testLimitDedupStillDropsCopiesThroughIdOnlyPlan: builds the plan withQueryUtil.buildPlanfor a request withsample_factor = 1.0andnull_property = true, asserts it isQueryPlan{stages=[PROJECTION_STAGE]}, feedsMapLimitIteratoroutput throughplan.execute(...)one row at a time, and checks that each of 100 keys comes out once with an empty value.sample_factoris set because its proto default, 0.0, builds a stop-only plan.No production code changes.
Verifying these changes
mvn test -pl hugegraph-store/hg-store-test -am -P store-server-test -Dtest=ProjectionStageTest -Dsurefire.failIfNoSpecifiedTests=false: 3 tests pass. WithProjectionStage.javareverted to its state before fix(store): stop ProjectionStage clearing dedup keys in place #3408, all three fail: the new test andtestLimitDedupStillDropsCopiesAfterProjectionwithkey 0 emitted twice, andtestRemoveAllPropertyLeavesInputColumnUnchangedon itsassertSame. IfbuildPlanstops adding the projection, only the new test fails.mvn test -pl hugegraph-store/hg-store-test -am -P store-server-test: 183 tests, 0 failures.mvn editorconfig:check -pl hugegraph-store/hg-store-test -ampasses.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.Documentation files in this PR or paired hugegraph-doc PR: