Cypher on SQL stores: all(), any(), none() and single() are two-valued where the predicate is null
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start at _quantifier() in drivine/cypher/sql/sql_cypher_compiler.py and compare its SQL generation with the described behavior in drivine4j and the cases in drivine-cypher-spec v0.6.7. Check how the generated query handles null predicates and null lists for all four quantifiers. Done means SQL stores match the stated three-valued Cypher semantics.
由索引模型根据 Issue 内容生成。
描述
Port of liberation-data/drivine4j#272.
What happens: on the SQL stores, all(), any(), none() and single() are two-valued where the predicate is null. Cypher's quantifiers are three-valued: a quantifier whose predicate is null for some item, with no item that decides it, is null.
MATCH (n:Person) WHERE none(x IN [1] WHERE n.name IN ['Keanu']) RETURN count(n)
MATCH (n:Person) WHERE all(x IN [1] WHERE n.name = 'x') RETURN count(n)
For a node with no name, Neo4j drops the row, because the quantifier is null. The SQL stores keep it, because NOT EXISTS (… WHERE NOT cond) reads a null cond as true.
Expected: three-valued quantifiers, as drivine4j does since liberation-data/drivine4j#283:
- all(): false if any item is false, else null if any is null, else true;
- any(): true if any is true, else null if any is null, else false;
- none(): the negation of any();
- single(): null when a null item could change the count of true items around one.
drivine4j keeps the cheap EXISTS forms in a WHERE that reads only the truth, where the predicate can't be null. Otherwise it uses one scalar count subquery, mapped to 1/0/NULL and compared = 1, and guards a null list. The cases are in drivine-cypher-spec v0.6.7.
Where: _quantifier() in drivine/cypher/sql/sql_cypher_compiler.py.
- 主要语言
- Python
- 星标
- 1
- 派生
- 0
- 平均合并
- 1 小时 29 分钟
- 30 天内合并 PR
- 136
环境准备
这个项目没有提供开发容器、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 天 新手友好度 55/100
liberation-data/drivine-python#297 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
liberation-data/drivine-python#295 ·
维护者通常 1 天内回复
查看 liberation-data/drivine-python 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 86/100
NousResearch/hermes-agent#147104 ·
维护者通常 1 天内回复
-
premises-missing
难度 1/5 1 小时以内 新手友好度 88/100
WingedGuardian/GENesis-AGI#3801 ·
维护者通常 1 天内回复
-
[oblt-aw][autodoc] Document new required `shared-org-key` input for `obs-aw-dependency-review`可能已有人在做 @github-actions 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
bot-triaged module: inductor oncall: pt2 topic: fuzzer triaged
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 4 天内回复