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
I'm passing a parameter to the following query in Kuzu and it doesn't seem to work as intended.
# Which are the top 5 cities in a particular country with the lowest average age in the network?query=""" MATCH (country:Country) WHERE co.country = $country AND EXISTS { MATCH (p:Person)-[:LivesIn]->(ci:City)-[*..2]->(country) } RETURN ci.city AS city, avg(p.age) AS averageAge ORDER BY averageAge LIMIT 5"""
Kuzu doesn't seem to like using the WHERE xx AND EXISTS {MATCH yy} clause, despite this being valid Cypher in Kuzu as per the example notebook.
Output:
Traceback (most recent call last):
File "/Users/prrao/code/kuzudb-study/kuzudb/query.py", line 85, in <module>
main(CONNECTION)
File "/Users/prrao/code/kuzudb-study/kuzudb/query.py", line 76, in main
run_query3(conn, params=[("country", "Canada")])
File "/Users/prrao/code/kuzudb-study/kuzudb/query.py", line 51, in run_query3
response = conn.execute(query, parameters=params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/prrao/.pyenv/versions/3.11.2/lib/python3.11/site-packages/kuzu/connection.py", line 88, in execute
self._connection.execute(
RuntimeError: Parser exception: Invalid input <MATCH (country:Country)
WHERE co.country = $country
AND EXISTS { MATCH (p:Person)-[:LivesIn]->(ci:City)-[*..>: expected rule oC_SingleQuery (line: 4, offset: 62)
" RETURN ci.city AS city, avg(p.age) AS averageAge"
The source of the error isn't clear, which needs a deeper dive. Query 4 also suffers from the same issue.
The text was updated successfully, but these errors were encountered:
I'm passing a parameter to the following query in Kuzu and it doesn't seem to work as intended.
Kuzu doesn't seem to like using the
WHERE xx AND EXISTS {MATCH yy}
clause, despite this being valid Cypher in Kuzu as per the example notebook.Output:
The source of the error isn't clear, which needs a deeper dive. Query 4 also suffers from the same issue.
The text was updated successfully, but these errors were encountered: