Compiled Cypher: a CALL's UNION ALL keeps its null and list marks from the first part only (port of drivine4j#512)
メンテナーはふだん 1 日以内に返信
関連するプルリクエストがすでにマージされています。
- #322 @jasperblues による — マージ済み
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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".
- 主要言語
- Python
- スター
- 1
- フォーク
- 0
- 平均マージ
- 1時間 32分
- マージ済み PR(30日)
- 149
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
liberation-data/drivine-python のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
liberation-data/drivine-python#363 ·
メンテナーはふだん 1 日以内に返信
-
Docs: drivine4j doesn't read the flat DATABASE_* variables, as 02-connecting.md and design.md sayオープンdocumentation
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
liberation-data/drivine-python#361 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
liberation-data/drivine-python#250 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
liberation-data/drivine-python#209 ·
メンテナーはふだん 1 日以内に返信
-
CI: three Oracle-only tests in test_cypher_compiled.py never run, as -k oracle doesn't select themオープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
liberation-data/drivine-python#178 ·
メンテナーはふだん 1 日以内に返信
liberation-data/drivine-python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
pytest-dev/pyfakefs#1367 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
IFEvalG exclude_word_harder misses the keyword next to punctuation, at the start or end of the text, and in other letter case対応中かも @damienen が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
allenai/open-instruct#2151 ·
メンテナーはふだん 1 日以内に返信
-
feat(plan): support convertorLabels and convertorAffinity in Plan resource対応中かも @AmenB が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
RedHatQE/openshift-python-wrapper#2849 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 25 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
libnativeapi/nativeapi#21 ·