fix(core): align count strategy connective steps#3037
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3037 +/- ##
============================================
- Coverage 36.11% 29.58% -6.53%
+ Complexity 338 264 -74
============================================
Files 803 803
Lines 68234 68241 +7
Branches 8964 8965 +1
============================================
- Hits 24640 20192 -4448
- Misses 40936 45696 +4760
+ Partials 2658 2353 -305 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates HugeGraph’s local HugeCountStrategy (a fork of TinkerPop’s CountStrategy) to handle ConnectiveStep (and() / or()) cases consistently with upstream TINKERPOP-2911 behavior, and adds regression tests to prevent drift.
Changes:
- Adjust
HugeCountStrategyto rewrite connective child traversals when convertingcount().is(0)patterns intonot(...). - Introduce a helper to build
NotStepwith a cloned traversal (so the whole child traversal is wrapped, not just its tail). - Add regression tests covering
and()/or()andwhere(or(...))multi-step shapes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/optimize/HugeCountStrategy.java | Updates count().is(0) rewrite logic to better handle ConnectiveStep traversals and centralizes NotStep creation. |
| hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/core/CountStrategyCoreTest.java | Adds schema support and new regression tests for connective and multi-step or() traversal shapes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b47943f to
5f7a01c
Compare
|
@imbajin I think this PR is ready to merge. It looks like the Codecov uploads were incomplete. |
Purpose of the PR
PR #2993 introduced
HugeCountStrategyto guard HugeGraph against unsafe negative-boundcount().is(P)optimizations.This follow-up ports the upstream TINKERPOP-2911
ConnectiveStephandling into HugeGraph's local strategy, soand()/or()child traversals are rewritten consistently with upstreamCountStrategy.Main Changes
ConnectiveStepseparately when convertingcount().is(0)intonot(...)not(...)using a cloned traversal, instead of only rewriting the tail stepFilterStepconversionand()/or()traversal shapes, including multi-stepwhere(or(...))casesVerifying these changes
Does this PR potentially affect the following parts?
Documentation Status
Doc - TODODoc - DoneDoc - No Need