Cypher on SQL stores: lists or maps holding a null relationship compare true, where Cypher gives null
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 1-2 天
- 新手友好度
- 61/100
调研方向
Start in drivine/cypher/sql/sql_cypher_compiler.py at _equality (around line 3068) and inspect how it compares JSON values and checks for nulls. Then add a direct regression case to tests/integration/test_cypher_compiled.py using the supplied Cypher statements; compare results on Postgres and Oracle with Cypher's expected null propagation. Done means both stores return null for equal collections containing nulls and false when a pair of items differs.
由索引模型根据 Issue 内容生成。
描述
Port of liberation-data/drivine4j#225.
What happens here: on Postgres and Oracle, a list or map equality that reaches a null item gives True, where Cypher and Neo4j give null. Run on main (d4932f7) through the cypher_pm fixture with QuerySpecification(cypher_statement(...)):
UNWIND [1] AS x OPTIONAL MATCH (p:Probe225)-[r:NOPE]->()
RETURN [[r] = [r], {x: r} = {x: r}, [r, 1] = [null, 1]]
gives [[True, True, True]] on both Postgres and Oracle. The relationship isn't needed for this. A null literal does the same:
RETURN [[null] = [null], {x: null} = {x: null}, [null, 1] = [null, 1], [1, null] = [2, null]]
gives [[True, True, True, False]] on both. Neo4j gives null, null, null, false. The last one is right: one pair differs, so the result is false.
Where: _equality (drivine/cypher/sql/sql_cypher_compiler.py:3068) compares the two sides' JSON whole (comparable(json(...)), :3086-3087). Its null test (:3093-3101) only checks whether each side as a whole is JSON null, so a list or map that holds a null item is compared as a document, and JSON '[null]' = JSON '[null]' is true on both stores. This matches drivine4j's guess: list and map equality compare the JSON documents whole.
Expected: null when a comparison reaches a null item and no pair of items differs, as Cypher's list and map equality does: [null] = [null] is null, and [1, null] = [2, null] is false.
Tests to port: whatever drivine4j adds for #225, probably a case in drivine-cypher-spec. The statements above make a direct test in tests/integration/test_cypher_compiled.py. SQLite isn't a store here yet (#93).
- 主要语言
- Python
- 星标
- 1
- 派生
- 0
- 平均合并
- 1 小时 13 分钟
- 30 天内合并 PR
- 109
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
liberation-data/drivine-python 的其他 Issue
-
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 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
liberation-data/drivine-python#219 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 57/100
liberation-data/drivine-python#218 ·
维护者通常 1 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 52/100
liberation-data/drivine-python#215 ·
维护者通常 1 天内回复
查看 liberation-data/drivine-python 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
MIT-LCP/wfdb-python#590 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
pollen-robotics/reachy_mini#1517 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 69/100
NRLMMD-GEOIPS/pluginify#41 ·
-
难度 2/5 1-3 小时 新手友好度 67/100
scverse/spatialdata#1293 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
UKGovernmentBEIS/inspect_evals#2788 ·
维护者通常 1 天内回复