Skip to content

Incorrect OR evaluation in JanusGraphStep #4786

@mkrutsky

Description

@mkrutsky

There's a noticeable difference in the evaluation of or() conditions together with vertex id. Depending on whether the initial vertex lookup is done with g.V().has(T.id, ...) or g.V(...). When using

g.V().has(T.id, 1).or(__.has("prop", "A", __.has("prop", "B")))

the query optimizer (JanusGraphStepStrategy) folds all conditions into a JanusGraphStep. This seems to lead to an incorrect evaluation where the or() behaves like an and() - in JanusGraphStep all conditions are evaluated using HasContainer.testAll() method.

However, the query

g.V(1).or(__.has("prop", "A", __.has("prop", "B")))

produces the correct OR results, because folding is skipped in JanusGraphStepStrategy.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions