ExpandInto doesn't properly resolve bidirectional traversals · Issue #1036 · RedisGraph/RedisGraph · GitHub
Skip to content

ExpandInto doesn't properly resolve bidirectional traversals #1036

Description

@jeffreylovitz

Given the graph created by:

CREATE ({v: 'src'})-[:E {v: 'edge'}]->({v: 'dest'})

The bidirectional conditional traversal works as expected:

redis-cli GRAPH.QUERY G "MATCH (a)-[e]-(b) RETURN a.v, e.v, b.v"
1) 1) "a.v"
   2) "e.v"
   3) "b.v"
2) 1) 1) "src"
      2) "edge"
      3) "dest"
   2) 1) "dest"
      2) "edge"
      3) "src"

But the logical equivalent with an ExpandInto causes an error:

"MATCH (a), (b) WITH a, b MATCH (a)-[e]-(b) RETURN a.v, e.v, b.v"
1) 1) "a.v"
   2) "e.v"
   3) "b.v"
2) 1) 1) "src"
      2) "edge"
      3) "dest"
3) (error) Type mismatch: expected a map but was Unknown

Depending on how the referenced edge e is accessed (such as with RETURN e), this can also manifest as an assertion failure.

The issue here is that ExpandInto doesn't have logic equivalent to https://github.com/RedisGraph/RedisGraph/blob/master/src/execution_plan/ops/op_conditional_traverse.c#L152-L159 .

This can be solved within ExpandInto, but I think it would be preferable to make shared logic functions for CondTraverse and ExpandInto to both use.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions