Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Cerrado
#116 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
1-2 días
Aptitud para principiantes
61/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
postgresql, python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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).

Lenguaje dominante
Python
Estrellas
1
Forks
0
Merge medio
1 h 21 min
PR fusionados (30 d)
128

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de liberation-data/drivine-python

Todos los issues de liberation-data/drivine-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.