Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Cypher on SQL stores: lists or maps holding a null relationship compare true, where Cypher gives null

已关闭
#116 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
1-2 天
新手友好度
61/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
postgresql, python
领域
databases, testing

调研方向

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,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

liberation-data/drivine-python 的其他 Issue

查看 liberation-data/drivine-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。