Skip to content

fix(server): avoid extracting text range filters#3034

Open
LegendPei wants to merge 1 commit into
apache:masterfrom
LegendPei:fix/fix-text-range-filter
Open

fix(server): avoid extracting text range filters#3034
LegendPei wants to merge 1 commit into
apache:masterfrom
LegendPei:fix/fix-text-range-filter

Conversation

@LegendPei
Copy link
Copy Markdown

@LegendPei LegendPei commented May 21, 2026

Purpose of the PR

This PR fixes the query-planning path exposed by #2935.

For top-level traversals like g.V().has("vp4", P.lt("")).repeat(...).count(),
HugeGraph may extract the text range predicate into a backend query. However,
range predicates on text properties should not be planned as backend range
index queries. This can make the direct traversal fail while an equivalent
match() traversal returns normally.

This change keeps such text range predicates in the traversal layer instead of
pushing them down to the backend query, making the direct traversal consistent
with the equivalent match() form.

Main Changes

  • Avoid extracting Text property predicates with gt/gte/lt/lte into
    HugeGraphStep / HugeVertexStep backend queries.
  • Preserve normal extraction for system properties and non-text property
    predicates.
  • Add a regression test for the reported traversal shape:
    has("vp4", P.lt("")).repeat(__.out("el2")).emit().times(1).count().
  • Verify that the direct traversal returns the same result as the equivalent
    match() traversal.

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:
    - mvn -pl hugegraph-server/hugegraph-test -am -P core-test,memory -Dtest=CountStrategyCoreTest#testRepeatAfterTextRangeFilterWithEmptyResult -DfailIfNoTests=false "-Drat.skip=true" "-Dcheckstyle.skip=true" test
    • mvn -pl hugegraph-server/hugegraph-test -am -P core-test,rocksdb -Dtest=CountStrategyCoreTest#testRepeatAfterTextRangeFilterWithEmptyResult -DfailIfNoTests=false "-Drat.skip=true" "-Dcheckstyle.skip=true" test

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 labels May 21, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Unexpected ArrayIndexOutOfBoundsException for filter-step and repeat()-step

1 participant