Cypher on SQL stores: a node given by coalesce() or CASE isn't a node, so MATCH (x)-->(d) from it, or labels(x), is refused (port of drivine4j#440)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start in drivine/cypher/sql/sql_cypher_compiler.py, reading the coalesce handling around line 4830, pattern variable handling around lines 1657 and 2441, and labels() around line 4802. Use TCK Match7 #22 and the two proposed queries from the issue to guide the behavior and tests. Done means node-valued coalesce and CASE expressions work as pattern inputs and with labels(), while a null node used as a pattern matches nothing.
由索引模型根据 Issue 内容生成。
描述
Port of liberation-data/drivine4j#440.
What happens. A node given by coalesce() or CASE is no longer a node in compiled Cypher. A pattern that starts from it, as in TCK Match7 #22's WITH coalesce(b, c) AS x MATCH (x)-->(d) RETURN d, is refused with "x is not a node, and is used as one in a pattern.", and labels(x) with "labels() takes a node.". Neo4j runs both. x.num works.
Where. coalesce always gives JSON, whatever its arguments (drivine/cypher/sql/sql_cypher_compiler.py:4830). A pattern accepts only a node value for a variable in scope (drivine/cypher/sql/sql_cypher_compiler.py:1657, and :2441 for writes). labels() takes only a node (drivine/cypher/sql/sql_cypher_compiler.py:4802). Read at drivine-python origin/main (7e2998e).
The fix. drivine4j has no fix yet. It proposes that a coalesce or CASE of nodes (or null literals) give a node value whose nid, labels, props and stamp are each the COALESCE or CASE of the arguments' columns, so a pattern from a null node matches nothing.
Tests to port. TCK Match7 #22, and from drivine4j#440: MATCH (a:Single) OPTIONAL MATCH (a)-->(c:NonExistent) WITH coalesce(c, a) AS x MATCH (x)-->(y) RETURN y.num and WITH CASE WHEN true THEN b ELSE a END AS x MATCH (x)-->(d) RETURN labels(d).
- 主要语言
- Python
- 星标
- 1
- 派生
- 0
- 平均合并
- 1 小时 21 分钟
- 30 天内合并 PR
- 128
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
liberation-data/drivine-python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
liberation-data/drivine-python#250 ·
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 88/100
liberation-data/drivine-python#209 ·
维护者通常 1 天内回复
-
CI: three Oracle-only tests in test_cypher_compiled.py never run, as -k oracle doesn't select them未关闭
难度 1/5 1 小时以内 新手友好度 88/100
liberation-data/drivine-python#178 ·
维护者通常 1 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 45/100
liberation-data/drivine-python#280 ·
维护者通常 1 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 68/100
liberation-data/drivine-python#279 ·
维护者通常 1 天内回复
查看 liberation-data/drivine-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
pytest-dev/pytest-html#1085 ·
-
难度 2/5 1-3 小时 新手友好度 90/100
pollen-robotics/reachy_mini#1527 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 66/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复