Oracle: a coalesce of a list of temporal values, or a list of lists or maps of them, still reads through JSON_TABLE and stalls the parse (port of drivine4j#347)
メンテナーはふだん 1 日以内に返信
関連するプルリクエストがすでにマージされています。
- #222 @jasperblues による — マージ済み
評価
調査の方向性
Start in drivine/cypher/sql/sql_cypher_compiler.py, especially _holds_temporals, coalesce, and the list-kind tracking around the cited lines. Read the ported drivine4j fix and inspect the named Oracle tests and CypherQueryContract for expected SQL and behavior. Done when temporal lists of the described shapes avoid JSON_TABLE, non-temporal lists still use it, and the guarded Oracle runs complete within 10 seconds.
索引モデルが issue の本文から書いたものです。
説明
Port of liberation-data/drivine4j#347.
Once #217 (the port of drivine4j#331) merges, Oracle reads a list by its places only where the compiler knows its items, or their items, are temporal values (_holds_temporals, drivine/cypher/sql/sql_cypher_compiler.py:5640 on oracle-parse-hang). It loses track in two places, and those lists still go to JSON_TABLE, whose parse over a list worked out with temporal arithmetic stalls the session:
coalesce(l, []):coalesce(sql_cypher_compiler.py:4579) builds its result with onlytemporal, notitems/item_items.- Three levels deep, or maps:
item_itemstracks kinds two levels down, socollect(DISTINCT [l, l]),collect(DISTINCT [x IN l | [x]]),collect(DISTINCT [x IN l | {t: x}])andUNWIND [x IN l | {t: x}] AS mgo toJSON_TABLE.
On Oracle 23.26, drivine4j measured 42 s for the coalesce, 43–106 s for the three-level lists, 105 s and over 120 s for the lists of maps. The results are right; only the parse is slow.
The fix in drivine4j (liberation-data/drivine4j#353): a compiled JSON value carries temporals, which says it holds a temporal value the statement makes at any depth. It is set by list and map literals, map projections, comprehensions, collect, CASE, coalesce, + and UNION. It is passed on by items, slices, map properties, WITH, reverse, tail, head, last, min and max. _holds_temporals also checks it, so Oracle reads such a list by its places. coalesce now also gives the items/item_items its arguments agree on, ignoring a written null or empty list (listKindOf in drivine4j). _item_kind_of ignores a written empty list too. Lists of other values keep JSON_TABLE, and Postgres and SQLite compile to the same SQL.
Tests to port:
OracleZonedListSortTest: SQL-shape checks for thecoalesce, deep and map statements, and for non-temporal lists that keepJSON_TABLE.OracleZonedListSortRunTest: the same statements run under its 10 s kill-and-abort guard.CypherQueryContract: "a coalesce of a list of temporal values worked out on each row, and lists or maps that hold such a list deeper, read item by item".
- 主要言語
- Python
- スター
- 1
- フォーク
- 0
- 平均マージ
- 1時間 19分
- マージ済み PR(30日)
- 122
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
liberation-data/drivine-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
liberation-data/drivine-python#252 · コメント 1 件 ·
メンテナーはふだん 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 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
liberation-data/drivine-python#243 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
liberation-data/drivine-python の issue をすべて見る
似ている issue
-
app: scripts status: backlog type: documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
netbox-community/netbox-scripts#68 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
marin-community/marin#10765 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
flathub/com.unity.UnityHub#230 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
namespace operations
難易度 1/5 1時間未満 初心者へのやさしさ 63/100
EclipseFdn/open-vsx.org#14910 ·
メンテナーはふだん 1 日以内に返信