You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Unexpected ArrayIndexOutOfBoundsException for filter-step and repeat()-step #2935
The first query thrown a exception: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
The second query returned the results normally.
Additional Context
We moved thehas(...) step and repeat()step in first query into the match()step and replace the repeat() with union() step, which should not affect the result.
When I executed these two queries on Janusgraph and Tinkerpop, they both returned the same results and were consistent with the results of the second query.
I have implemented a fuzzing tool and am using it to test HugeGraph. To reduce the burden on developers, I have simplified the test cases as much as possible and isolated irrelevant information.
This is a known HugeGraph 1.7.0 bug: top-level filter steps (like has() with repeat()) can throw exceptions such as ArrayIndexOutOfBoundsException, while equivalent queries using match() or nested traversals work as expected. The root cause is that HugeGraph's query planner pushes top-level filters into backend queries and expects certain label/property arrays to be non-empty; when they're empty (as in your query), the traversal engine (e.g., NestedIterator or HugeTraverser) tries to access an array index that doesn't exist, causing the exception. In contrast, filters inside match() are applied in-memory after data retrieval, bypassing this bug. Other graph databases like JanusGraph and TinkerPop do not have this inconsistency, so both query forms work there.
There is no fix or official workaround in 1.7.0, but rewriting your query to use match() or nested traversals avoids the exception and returns the expected result. This pattern has been reported by other users for similar query forms and is a limitation of HugeGraph's current query planner and filter handling. See related discussion and technical details
Activity
dosubot commentedon Jan 7, 2026
This is a known HugeGraph 1.7.0 bug: top-level filter steps (like
has()withrepeat()) can throw exceptions such asArrayIndexOutOfBoundsException, while equivalent queries usingmatch()or nested traversals work as expected. The root cause is that HugeGraph's query planner pushes top-level filters into backend queries and expects certain label/property arrays to be non-empty; when they're empty (as in your query), the traversal engine (e.g.,NestedIteratororHugeTraverser) tries to access an array index that doesn't exist, causing the exception. In contrast, filters insidematch()are applied in-memory after data retrieval, bypassing this bug. Other graph databases like JanusGraph and TinkerPop do not have this inconsistency, so both query forms work there.There is no fix or official workaround in 1.7.0, but rewriting your query to use
match()or nested traversals avoids the exception and returns the expected result. This pattern has been reported by other users for similar query forms and is a limitation of HugeGraph's current query planner and filter handling.See related discussion and technical details
To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.