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

Cypher on SQL stores: all(), any(), none() and single() are two-valued where the predicate is null

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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python, sql
領域
backend, database

調査の方向性

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時間 13分
マージ済み PR(30日)
109

環境構築

このプロジェクトには開発コンテナ、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 を短くまとめたダイジェスト。