Loupi / node-cypher-parser

A Cypher parser/linter addon module for NodeJS.
MIT License
36 stars 9 forks source link

CALL procedure used as subquery is not getting parsed #31

Open bharath-nz opened 2 years ago

bharath-nz commented 2 years ago

Hi Loupi, If I have a call procedure in the subquery (example below), it is not getting parsed and I get a cypher parser error from the AST generated. Could you please check this?

I am using a query like this

MATCH (a:Movie)-[:HAS]->(s:DIRECTOR) CALL { WITH s MATCH (n:Person)-[r:IS]->(s:DIRECTOR{id: s.id})  RETURN
count(distinct(n)) as total_directors_in_people } WITH s, a, total_directors_in_people 
where total_directors_in_people > 10  RETURN a.name, s.name;

the error is CALL { WITH s MATCH (n:Person)-[r:IS]->(s:DIRECTOR{id: s.id}) RETURN count(distinct(n)) as total_directors_in_people } this subquery is not recognized by the parser now.

Loupi commented 2 years ago

This is related to this libcypher-parser issue, on which node-cypher-parser depends: https://github.com/cleishm/libcypher-parser/issues/33

cylindrical2002 commented 4 months ago

Hi Loupi, If I have a call procedure in the subquery (example below), it is not getting parsed and I get a cypher parser error from the AST generated. Could you please check this?

I am using a query like this

MATCH (a:Movie)-[:HAS]->(s:DIRECTOR) CALL { WITH s MATCH (n:Person)-[r:IS]->(s:DIRECTOR{id: s.id})  RETURN
count(distinct(n)) as total_directors_in_people } WITH s, a, total_directors_in_people 
where total_directors_in_people > 10  RETURN a.name, s.name;

the error is CALL { WITH s MATCH (n:Person)-[r:IS]->(s:DIRECTOR{id: s.id}) RETURN count(distinct(n)) as total_directors_in_people } this subquery is not recognized by the parser now.

Look like this feature is not in Open Cypher 9 Standard, you can read this railroad.