Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#159 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python, sql
Ambito
backend, database

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
1
Fork
0
Merge medio
1h 16m
PR unite (30g)
74

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di liberation-data/drivine-python

Tutte le issue di liberation-data/drivine-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.