You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WITH clause fails to parse, despite being mentioned in DeepWiki docs #102
ValueError: Cypher parse error ... input: WITH b, count(...)
Proposal
Rewriting without WITH works, but loses some expressiveness. But WITH does help a lot of Cypher beginners write queries as they're learning, so it's a useful add.
I'm getting the following error when running in local
>>> CypherQuery(query).with_config(cfg).explain(datasets)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Query planning error: Failed to build aggregate: Schema error: No field named b. Valid fields are a__id, follows_1__src, follows_1__dst, b__id, a__id, follows_1__src, follows_1__dst, b__id.
Ah yes, but this is the pattern I need to use. And combining WITH with DISTINCT doesn't seem to work.
MATCH (p:Person)<-[:commentHasCreator]-(c:Comment)<-[:likeComment]-(p2:Person)
WHEREp.firstName="Rafael"ANDp.lastName="Alonso"WITHDISTINCTp2.IDASidRETURNcount(id) ASnum_persons;
Gives:
Traceback (most recent call last):
File "/Users/prrao/code/graph-benchmark-ldbc-snb/lance_graph/query.py", line 490, in <module>
main(selected_queries)
~~~~^^^^^^^^^^^^^^^^^^
File "/Users/prrao/code/graph-benchmark-ldbc-snb/lance_graph/query.py", line 483, in main
func(cfg, datasets)
~~~~^^^^^^^^^^^^^^^
File "/Users/prrao/code/graph-benchmark-ldbc-snb/lance_graph/query.py", line 252, in run_query13
return _execute(cfg, datasets, 13, query)
File "/Users/prrao/code/graph-benchmark-ldbc-snb/lance_graph/query.py", line 119, in _execute
result = execute_query(query, cfg, datasets)
File "/Users/prrao/code/graph-benchmark-ldbc-snb/lance_graph/query.py", line 107, in execute_query
cypher = CypherQuery(query)
ValueError: Cypher parse error at position 0: Failed to parse Cypher query: Parsing Error: Error { input: "WITH DISTINCT p2.ID AS id\nRETURN count(id) AS num_persons;\n ", code: Tag }
Ah yes, but this is the pattern I need to use. And combining WITH with DISTINCT doesn't seem to work.
MATCH (p:Person)<-[:commentHasCreator]-(c:Comment)<-[:likeComment]-(p2:Person)
WHERE p.firstName = "Rafael" AND p.lastName = "Alonso"
WITH DISTINCT p2.ID AS id
RETURN count(id) AS num_persons;
Gives:
Traceback (most recent call last):
File "/Users/prrao/code/graph-benchmark-ldbc-snb/lance_graph/query.py", line 490, in <module>
main(selected_queries)
~~~~^^^^^^^^^^^^^^^^^^
File "/Users/prrao/code/graph-benchmark-ldbc-snb/lance_graph/query.py", line 483, in main
func(cfg, datasets)
~~~~^^^^^^^^^^^^^^^
File "/Users/prrao/code/graph-benchmark-ldbc-snb/lance_graph/query.py", line 252, in run_query13
return _execute(cfg, datasets, 13, query)
File "/Users/prrao/code/graph-benchmark-ldbc-snb/lance_graph/query.py", line 119, in _execute
result = execute_query(query, cfg, datasets)
File "/Users/prrao/code/graph-benchmark-ldbc-snb/lance_graph/query.py", line 107, in execute_query
cypher = CypherQuery(query)
ValueError: Cypher parse error at position 0: Failed to parse Cypher query: Parsing Error: Error { input: "WITH DISTINCT p2.ID AS id\nRETURN count(id) AS num_persons;\n ", code: Tag }
Activity
prrao87 commentedon Jan 27, 2026
Related to #86, hopefully can test this on the real datasets once a new release of lance-graph is made.
aheev commentedon Jan 27, 2026
I'm getting the following error when running in local
aheev commentedon Jan 27, 2026
@prrao87 Got it. You can't alias whole nodes or relationships. For ex below query works
aheev commentedon Jan 27, 2026
raised new issue: #109
prrao87 commentedon Jan 27, 2026
Ah yes, but this is the pattern I need to use. And combining
WITHwithDISTINCTdoesn't seem to work.Gives:
aheev commentedon Jan 28, 2026
It's already listed here
prrao87 commentedon Feb 2, 2026
Fixed in 0.5.0 release.