vesoft-inc / nebula

A distributed, fast open-source graph database featuring horizontal scalability and high availability
https://nebula-graph.io
Apache License 2.0
10.73k stars 1.2k forks source link

[incompatible OpenCypher] with size() for degrees #2625

Open wey-gu opened 3 years ago

wey-gu commented 3 years ago

Describe the bug (must be provided) Syntax parsing is not expected.

How To Reproduce(must be provided)

MATCH p=(n:player)-[]->(m:player) WITH p, size((m)-[]->()) as right_out, size((n)<-[]-()) as left_in \
WHERE right_out == 0 AND left_in == 0 RETURN p;
(root@nebula) [basketballplayer]> MATCH p=(n:player)-[]->(m:player) WITH p, size((m)-[]->()) as right_out, size((n)<-[]-()) as left_in \
                               -> WHERE right_out == 0 AND left_in == 0 RETURN p;
[ERROR (-7)]: SyntaxError: syntax error near `]->()) a'

Thu, 22 Jul 2021 12:16:33 CST

Expected behavior

MATCH p=(n:Person)-[]->(m:Movie) WITH p, size((m)-[]->()) as left_out, size((n)<-[]-()) as left_in
WHERE right_out = 0 AND right_in = 0 RETURN p;

╒══════════════════════════════════════════════════════════════════════╕
│"p"                                                                   │
╞══════════════════════════════════════════════════════════════════════╡
│[{"louvain":5,"degree":0.0,"name":"Emil Eifrem","born":1978},{"roles":│
│["Emil"]},{"louvain":5,"degree":8.0,"tagline":"Welcome to the Real Wor│
│ld","votes":372,"title":"The Matrix","released":1999}]                │
├──────────────────────────────────────────────────────────────────────┤
│[{"louvain":5,"degree":0.0,"name":"Joel Silver","born":1952},{},{"louv│
│ain":5,"degree":8.0,"tagline":"Welcome to the Real World","votes":372,│
│"title":"The Matrix","released":1999}]                                │
├──────────────────────────────────────────────────────────────────────┤

...

Additional context

related topic in forum: https://discuss.nebula-graph.com.cn/t/topic/4947

jievince commented 3 years ago

We have not support use pattern in WITH yet