bitnine-oss / agensgraph

AgensGraph, a transactional graph database based on PostgreSQL
http://www.agensgraph.org
Other
1.32k stars 146 forks source link

Cypher read clauses cannot follow update clauses #589

Closed aviNrich closed 1 year ago

aviNrich commented 1 year ago

Hi, The following query is working in NEO, why isn't it working in AgensGraph?

MERGE(n:Institutes {AppId : $1}) 

      ON CREATE SET 
              n.AppId=$1 with n MATCH(g:GraphTarget) WHERE g.AppId = $1 

MERGE(g)-[:MyInstitutes]->(n)

thanks

aviNrich commented 1 year ago

@emotionbug , is this bug solved? Thanks

emotionbug commented 1 year ago

I will investigate this issue. Apologies for late.

aviNrich commented 1 year ago

@emotionbug thank you, Ill be happy to get a response as soon as you know the ETA, we are thinking to migrate to agensgraph but this is a show stopper and we cant continue our POC without it. Thanks

emotionbug commented 1 year ago

These restrictions can be resolved quickly, but we need time to verify that they produce the right results. :)

I'll reply asap.

-- #589 ( Cypher read clauses cannot follow update clauses )
CREATE GRAPH cypher_dml2;
SET GRAPH_PATH to cypher_dml2;
CREATE VLABEL main;
CREATE ELABEL main2;
CREATE (n:another {id: 593}) RETURN n.id;
 id  
-----
 593
(1 row)

MERGE (n:main {id: 593})
ON CREATE SET n.id = 593
WITH n
MATCH (g: another)
WHERE g.id = 593
MERGE (g)-[:main2]->(n);
MATCH ()-[e:main2]-() RETURN e;
           e           
-----------------------
 main2[4.1][5.1,3.1]{}
 main2[4.1][5.1,3.1]{}
(2 rows)

MATCH (g: another) RETURN g;
            g            
-------------------------
 another[5.1]{"id": 593}
(1 row)

MATCH (g: main) RETURN g;
          g           
----------------------
 main[3.1]{"id": 593}
(1 row)

DROP GRAPH cypher_dml2 CASCADE;
aviNrich commented 1 year ago

@emotionbug do you have estimation for that? Thanks

emotionbug commented 1 year ago

@aviNrich Applied commit about this issue. you can run tests with following branches.

aviNrich commented 1 year ago

@emotionbug can I use docker for that? Can you build these tag in docker for me? Thanks

aviNrich commented 1 year ago

@emotionbug can you please share how to build a docker image out of 2.14? Thanks