0

If I execute the following query

SELECT * FROM ag_catalog.cypher('graph', $$
match (p:Project)-[:Has]->(t:Task)-[:AssignedTo]->(u:Person)
with distinct t, {tn: t.name, user: collect(u)} as task
with distinct p, {pn: p.name, task: collect(task)} as project
return project
$$) as (p agtype);

the segmentation fault occurs.

and if I execute this query

SELECT * FROM ag_catalog.cypher('graph', $$
match (p:Project)-[:Has]->(t:Task)-[:AssignedTo]->(u:Person)
with p, t, collect(u) as users
with p, {tn: t.name, users: users} as task
with p, collect(task) as tasks
with {pn: p.name, tasks:tasks} as project
return project
$$) as (p agtype);

the error message "container is not an agtype array" is shown.

run the query and see the result. The above query works fine with neo4j.

M Jin
  • 11
  • 1

1 Answers1

0

The segmentation fault error was due to a bug in WITH clause, which has been fixed in the recent commits to AGE. Now it will error out saying that p is undefined in second WITH statement. If you want to use p in the statements prior to MATCH, you should pass it on from all WITH clauses like below.

SELECT * FROM ag_catalog.cypher('graph', $$
match (p:Project)-[:Has]->(t:Task)-[:AssignedTo]->(u:Person)
with p,distinct t, {tn: t.name, user: collect(u)} as task
with distinct p, {pn: p.name, task: collect(task)} as project
return project
$$) as (p agtype);