ftsrg / ingraph

Incremental view maintenance for openCypher graph queries.
http://docs.inf.mit.bme.hu/ingraph/
Eclipse Public License 1.0
48 stars 10 forks source link

Edge direction lost when creating path #342

Closed marci543 closed 6 years ago

marci543 commented 6 years ago

This test fails, because the direction of the first edge is opposite. https://github.com/opencypher/openCypher/blob/b60f0f8b98fd7309ffc85e2e3244d41a094d6a4d/tck/features/MatchAcceptance.feature#L144-L159

jmarton commented 6 years ago

TL;DR: Both GPlan, NPlan and FPlan seem to have the correct edge directions as the plans below show. @szarnyasg please take a look at the CUD part of the engine.

Details:

In the plans for the CREATE query

CREATE (:A)<-[:KNOWS {name: 'monkey'}]-()-[:KNOWS {name: 'woot'}]->(:B)

_e0#0 stands for (:A), _e1#0 stands for the anonymous node pattern (), and the name: monkey edge is created as pointing Inward to _e0#0

-----------------------------------------------------------------------------
GPlan:
------
'Production
+- 'Create [v(_e0, {A}, true, (_e0#0)), v(_e1, {}, true, (_e1#0)), riche(v(_e0, {A}, true, (_e0#0)), v(_e1, {}, true, (_e1#0)), e(_e2, {KNOWS}, (name,monkey), true, (_e2#0)), In), v(_e3, {B}, true, (_e3#0)), riche(v(_e1, {}, true, (_e1#0)), v(_e3, {B}, true, (_e3#0)), e(_e4, {KNOWS}, (name,woot), true, (_e4#0)), Out)]
   +- Dual

-----------------------------------------------------------------------------
NPlan:
------
'Production
+- 'Create riche(v(_e1, {}, true, (_e1#0)), v(_e3, {B}, true, (_e3#0)), e(_e4, {KNOWS}, (name,woot), true, (_e4#0)), Out)
   +- 'Create v(_e3, {B}, true, (_e3#0))
      +- 'Create riche(v(_e0, {A}, true, (_e0#0)), v(_e1, {}, true, (_e1#0)), e(_e2, {KNOWS}, (name,monkey), true, (_e2#0)), In)
         +- 'Create v(_e1, {}, true, (_e1#0))
            +- 'Create v(_e0, {A}, true, (_e0#0))
               +- Dual

-----------------------------------------------------------------------------
FPlan:
------
Production
+- Create riche(v(_e1, {}, true, (_e1#0)), v(_e3, {B}, true, (_e3#0)), e(_e4, {KNOWS}, (name,woot), true, (_e4#0)), Out)
   +- Create v(_e3, {B}, true, (_e3#0))
      +- Create riche(v(_e0, {A}, true, (_e0#0)), v(_e1, {}, true, (_e1#0)), e(_e2, {KNOWS}, (name,monkey), true, (_e2#0)), In)
         +- Create v(_e1, {}, true, (_e1#0))
            +- Create v(_e0, {A}, true, (_e0#0))
               +- Dual Dual
szarnyasg commented 6 years ago

Thanks, submitting a fix now.