vaidikgarg-bit opened a new pull request, #3408:
URL: https://github.com/apache/hugegraph/pull/3408

   ## Purpose of the PR
   
   - close #3407
   
   Follow-up to #3404, from @bitflicker64's review there. `MapLimitIterator` 
keeps each emitted `RocksDBSession.BackendColumn` in its dedup set and passes 
the same object downstream. On an id-only `PRIMARY_SCAN` (`null_property = 
true`, no property list, condition, order-by or aggregation) with `dedup_option 
= LIMIT_DEDUP`, `ProjectionStage.handle()` set `column.value = new byte[0]` on 
that object. The key stored in the set changed after insertion, so it no longer 
equalled a later byte-equal row and the copy was emitted again. @bitflicker64's 
probe got 200 rows for 100 keys read twice; on `master` the new test fails with 
`key 0 emitted twice`.
   
   ## Main Changes
   
   - `ProjectionStage.handle()`: in the `BACKEND_COLUMN` branch with 
`removeAllProperty`, replace the result's column with 
`BackendColumn.of(column.name, new byte[0])` instead of clearing `value` on the 
shared object.
   - New `ProjectionStageTest` in `hg-store-test`, registered in 
`ServerSuiteTest`:
     - projection returns the same name with an empty value and leaves the 
input column unchanged;
     - `MapLimitIterator` followed by the projection on each emitted row 
returns each of 100 keys once.
   
   Only a gRPC client that sets `dedup_option` reaches this path today, since 
`StoreQueryParam` fixes it to `NONE`.
   
   ## Verifying these changes
   
   - [ ] Trivial rework / code cleanup without any test coverage. (No Need)
   - [ ] Already covered by existing tests, such as *(please modify tests 
here)*.
   - [x] Need tests and can be verified as follows:
       - `mvn test -pl hugegraph-store/hg-store-test -am -P store-server-test 
-Dtest=ProjectionStageTest -Dsurefire.failIfNoSpecifiedTests=false`: both tests 
fail on `master` (a key is emitted twice; the input column's value is cleared) 
and pass with this change.
       - `mvn test -pl hugegraph-store/hg-store-test -am -P store-server-test`: 
182 tests, 0 failures.
       - `mvn test -pl hugegraph-store/hg-store-test -am -P store-core-test`: 
141 tests, 0 failures (1 skipped, `IpUtilTest`, an environment assumption).
       - `mvn editorconfig:check -pl hugegraph-store/hg-store-test -am` passes.
   
   ## Does this PR potentially affect the following parts?
   
   - [ ]  Dependencies ([add/update 
license](https://hugegraph.apache.org/docs/contribution-guidelines/contribute/#321-check-licenses)
 info & 
[regenerate_known_dependencies.sh](../install-dist/scripts/dependency/regenerate_known_dependencies.sh))
   - [ ]  Modify configurations
   - [ ]  The public API
   - [ ]  Other affects (typed here)
   - [x]  Nope
   
   ## Documentation Status
   
   - [ ] `Doc - TODO`: required documentation is pending; complete it before 
merging.
   - [ ] `Doc - Done`: documentation is included here or linked below.
   - [x] `Doc - No Need`: no user-visible documentation is affected.
   
   Documentation files in this PR or paired hugegraph-doc PR:
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to