Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

クローズ
#116 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
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時間 19分
マージ済み PR(30日)
122

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

liberation-data/drivine-python のほかの issue

liberation-data/drivine-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。