Compiled Cypher: a CALL's UNION ALL keeps its null and list marks from the first part only (port of drivine4j#512)
Maintainer thường phản hồi trong vòng 1 ngày
Một pull request liên quan đã được merge.
- #322 của @jasperblues — đã merge
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 56/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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".
- Ngôn ngữ chính
- Python
- Star
- 1
- Fork
- 0
- Merge trung bình
- 1 giờ 32 phút
- Pull request đã merge (30 ngày)
- 149
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của liberation-data/drivine-python
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
liberation-data/drivine-python#363 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Docs: drivine4j doesn't read the flat DATABASE_* variables, as 02-connecting.md and design.md sayĐang mởdocumentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
liberation-data/drivine-python#361 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
liberation-data/drivine-python#250 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
liberation-data/drivine-python#209 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CI: three Oracle-only tests in test_cypher_compiled.py never run, as -k oracle doesn't select themĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
liberation-data/drivine-python#178 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của liberation-data/drivine-python
Issue tương tự
-
question
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
conda-forge/vc-feedstock#132 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
limitlessprojects/Go-Hybrid#3342 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
UKGovernmentBEIS/inspect_ai#6268 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
LSSTDESC/rail_sompz#42 ·
-
All tests fail with 'EXITED with status 3' on pytest 9.2.0 (TestReport._id is not marshallable)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
pytest-dev/pytest-forked#113 ·