Compiled Cypher: a CALL's UNION ALL keeps its null and list marks from the first part only (port of drivine4j#512)
Maintainer antworten meist innerhalb von 1 Tag
Ein zugehöriger Pull Request wurde bereits gemerged.
- #322 von @jasperblues — gemerged
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 56/100
Rechercherichtung
Start at _called_union in drivine/cypher/sql/sql_cypher_compiler.py, especially the merge loop around line 1874, and compare how it combines marks across UNION ALL parts. Port the named cases from CypherQueryCrossEngineTest.kt and the two steps from spec v0.20.0. Done means the null and list marks merge as described and the regression cases match the expected Neo4j behavior.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Port of liberation-data/drivine4j#512 (fixed by liberation-data/drivine4j#514). This adds to the note already in #314.
What happens here now: _called_union (drivine/cypher/sql/sql_cypher_compiler.py:1834, merge loop at ~1874) builds each merged column with dataclasses.replace(projected[0]'s value, …). It recomputes only row_keys, from_list, temporal, items, item_items, temporals, text, texts and known across the parts. Every other mark comes from the first part only: JSON's-null (#314's note), and the marks for a list, a list of lists, and a flat list. So when parts differ in kind, the merged column sorts and compares by the first part's kind.
drivine4j's wrong rows before its fix:
CALL { RETURN [10] AS v UNION ALL RETURN 10 AS v } RETURN v ORDER BY vgave[10, [10]]; Neo4j gives[[10], 10].v < 2over[1] ∪ 1gave[null, null]; Neo4j gives[null, true].v = [1]andv IN [[1], 1]over[1] ∪ [null]gave[true, false]; Neo4j gives[true, null].UNWIND vover[[1]] ∪ [1], then ORDER BY, gave[1, [1]]; Neo4j gives[[1], 1].CALL { RETURN {}.a AS v UNION ALL RETURN [null][0] AS v } RETURN DISTINCT vgave two nulls; Neo4j gives one.
What the fix does: in calledUnion, the JSON's-null mark is set if any part has it. The list, list-of-lists and flat marks are kept only where every part has them, like text/texts.
Tests to port:
- drivine4j
CypherQueryCrossEngineTest.kt: "a CALL's UNION ALL whose later part gives a list's null keeps it one null with a missing key", and "a CALL's UNION ALL whose first part gives a list and a later one a number or a map sorts each by its kind". The second skips Postgres (#307 there) and compares rows without ORDER BY as a multiset. - Spec v0.20.0 (drivine-cypher-spec #45): two steps in "A null in a map and a missing key are one null".
- Vorherrschende Sprache
- Python
- Sterne
- 1
- Forks
- 0
- Ø Merge
- 1 Std. 32 Min.
- Gemergte PRs (30 T.)
- 149
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus liberation-data/drivine-python
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
liberation-data/drivine-python#363 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Docs: drivine4j doesn't read the flat DATABASE_* variables, as 02-connecting.md and design.md sayOffendocumentation
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 78/100
liberation-data/drivine-python#361 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
liberation-data/drivine-python#250 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
liberation-data/drivine-python#209 ·
Maintainer antworten meist innerhalb von 1 Tag
-
CI: three Oracle-only tests in test_cypher_compiled.py never run, as -k oracle doesn't select themOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
liberation-data/drivine-python#178 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in liberation-data/drivine-python
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Nixtla/mlforecast#823 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
microsoft/ML-For-Beginners#1061 ·
-
bot-found documentation priority: P3
Schwierigkeit 2/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
madenvel/KalinkaPlayer#503 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 63/100
EleutherAI/lm-evaluation-harness#4508 ·
Maintainer antworten meist innerhalb von 1 Tag