Skip to content

fix(core): skip unsafe count optimization for nested predicates#3100

Open
lokidundun wants to merge 1 commit into
apache:masterfrom
lokidundun:fix-issue-3085
Open

fix(core): skip unsafe count optimization for nested predicates#3100
lokidundun wants to merge 1 commit into
apache:masterfrom
lokidundun:fix-issue-3085

Conversation

@lokidundun

Copy link
Copy Markdown
Contributor

Purpose of the PR

Main Changes

  • Avoid applying HugeCountStrategy to count().is(...) traversals
    containing nested connective predicates.
  • Keep the original CountGlobalStep + IsStep traversal for nested
    predicates, so that TinkerPop evaluates the complete predicate tree.
  • Preserve the existing optimization for simple predicates and flat
    connective predicates.
  • Prevent partially analyzed nested predicates from being transformed
    into RangeGlobalStep or NotStep, which can change or invert the
    filtering semantics.
  • Add regression tests for a nested connective predicate and its
    negated form.

Verifying these changes

  • Trivial rework / code cleanup without any test coverage. (No Need)
  • Already covered by existing tests, such as (please modify tests here).
  • Need tests and can be verified as follows:
    • xxx

Does this PR potentially affect the following parts?

Documentation Status

  • Doc - TODO
  • Doc - Done
  • Doc - No Need

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working tests Add or improve test cases labels Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files. tests Add or improve test cases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Wrong result for where(count().is()

1 participant