Oracle engine adapter: scope proposal before implementation
メンテナーはふだん 4 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 15/100
調査の方向性
Start by reading the proposed adapter constraints and the named entry points, especially sqlmesh/utils/migration.py and FORBIDDEN_STATE_SYNC_ENGINES; inspect SQLMesh’s existing engine adapters and SQLGlot’s Oracle dialect. The issue asks maintainers to decide scope, ownership, review split, CI, and dependency sequencing before implementation, so there is no implementation task or completion criterion yet.
索引モデルが issue の本文から書いたものです。
説明
I would like to implement an Oracle engine adapter and contribute it upstream. Before writing
several thousand lines, I want to agree the scope with the maintainers, since Oracle has a number
of semantics that force product-visible decisions rather than purely internal ones.
Three earlier requests were closed as not planned with an invitation to contribute: #2156
("happy to work with someone to add it"), #2784 ("happy to accept a well crafted and tested PR"),
and #2236 ("happy to partner with a company interested in oracle"). I am picking this up on that
basis. As far as I can tell nobody is currently working on it — please tell me if that is wrong.
What I propose to build
An OracleEngineAdapter targeting Oracle 19c and above, with Oracle usable as a data warehouse
only.
Scope decisions I have provisionally made, with the reasoning:
State sync in Oracle: out of scope. index_text_type (sqlmesh/utils/migration.py) has no
Oracle entry, so _snapshots columns name, identifier, version and dev_version would be
generated as CLOB. Oracle does not permit CLOB in a primary key and does not support equality
on CLOB, so the state schema cannot be created at all. Validating the 87+ migrations against a
live Oracle is a body of work comparable to the adapter itself. I propose adding oracle to
FORBIDDEN_STATE_SYNC_ENGINES for the first version, with state kept in Postgres or DuckDB.
Model kinds in v1: FULL, VIEW, EMBEDDED, INCREMENTAL_BY_TIME_RANGE, INCREMENTAL_BY_UNIQUE_KEY.
INCREMENTAL_BY_PARTITION is excluded because SQLGlot has no Oracle partitioning support at all.
MANAGED is excluded. SCD_TYPE_2 depends on how MERGE is resolved (see below).
Schema creation. In Oracle a schema is a user; CREATE SCHEMA does not create a schema in any
version, including 26ai. Creating one requires CREATE USER ... GRANT ..., plus a tablespace quota
or GRANT UNLIMITED TABLESPACE, otherwise the first insert fails with ORA-01950.
Whether SQLMesh can do that itself depends on the deployment. In a multitenant setup — the norm on
19c, where non-CDB is deprecated — DBA is commonly granted PDB-locally
(GRANT DBA TO app_owner CONTAINER=CURRENT), which does not touch the CDB or sibling PDBs. Teams
that get their own PDB, and Autonomous Database users who get ADMIN, can create users freely.
Where the service account is a restricted local user in a shared PDB, they cannot.
So I propose the adapter detects rather than assumes: check SESSION_PRIVS for CREATE USER and
create schemas on the fly when the privilege is present, matching SQLMesh's behaviour on every
other engine; otherwise fail with a clear error naming the schemas a DBA has to pre-create. I would
like your view on whether that detection belongs in the adapter or should be an explicit
configuration option.
MERGE. Oracle MERGE does not support WHEN NOT MATCHED BY SOURCE, does not allow updating
join key columns, and permits exactly one WHEN MATCHED and one WHEN NOT MATCHED clause. So
neither the base merge() nor the MSSQL-style implementation transfers. The options are a custom
merge() or LogicalMergeMixin (delete + insert). The latter is slower but much simpler and would
bring SCD_TYPE_2 along nearly for free.
Upstream SQLGlot work
Some of this cannot be fixed in the adapter because it leaks into user model SQL. The Oracle
dialect currently emits SQL that is invalid on 19c:
- No
BOOLEANmapping inTYPE_MAPPING; 19c and 21c have no column-levelBOOLEANtype at all MINUSis tokenized toTokenType.EXCEPTbut never generated back, so an Oracle-to-Oracle
round trip ofMINUSproducesEXCEPT, which is invalid before 23ai- The
VALUEStable constructor is emitted verbatim; it does not exist before 23ai
SQLGlot already supports per-version dialect branching — SUPPORTED_SETTINGS includes version,
and postgres, duckdb, spark and clickhouse branch on self.dialect.version — but the Oracle
dialect does not use it. So these can be fixed properly rather than by picking one target version.
Note that IF [NOT] EXISTS was backported to 19c in RU 19.28, so that particular gap has a
version threshold rather than a hard floor.
Questions
- Is the scope above acceptable in principle, in particular state sync being out of scope and
schemas needing to pre-exist? - Does this need a TSC decision, or is a maintainer sign-off enough?
- How would you like the work split for review? The StarRocks contribution (#5832) landed as a
single 25-file PR. I can follow that shape, or split adapter, tests, CI and docs. - Is CI time a concern?
gvenzl/oracle-free:23-slim-faststartis about 1.2 GB compressed and one
container, which is lighter than the Trino stack already running per PR, but Oracle Free is
capped at 2 CPU threads and 2 GB SGA, so the integration suite will be slower than other engines. - Would you prefer the SQLGlot changes to land first, or in parallel with the adapter?
- What is the expectation for
sqlglot~=30.8.0inpyproject.tomlif the dialect fixes land in
a later SQLGlot release?
Happy to adjust any of this. If there is prior context from the earlier sponsorship discussion
mentioned in #2236, I would like to know it before starting.
- 主要言語
- Python
- スター
- 3.3k
- フォーク
- 471
- 平均マージ
- 6日 7時間
- マージ済み PR(30日)
- 35
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
SQLMesh/sqlmesh のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
SQLMesh/sqlmesh#6008 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
VSCode Extension: SQLMesh LSP crashes on startup: ImportError: cannot import name 'WorkspaceDiagnosticRefreshRequest' with lsprotocol 2025.x対応中かも @boomesh11 が 15 日前に担当しました。 オープンBug
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 4 日以内に返信
-
Improvement
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
SQLMesh/sqlmesh#5696 · コメント 6 件 ·
メンテナーはふだん 4 日以内に返信
SQLMesh/sqlmesh の issue をすべて見る
似ている issue
-
[BUG][Low–Medium] founder_numbers.py silently reads a SAFE discount or pool target given as a fraction (0.2) as 0.2%対応中かも @sumitkhond111-del が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
bmad-code-org/BMAD-METHOD#3358 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
open-mmlab/mmcv#3352 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
OpenGithubs/weekly#263 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
comp/cli P3 type/feature
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
NousResearch/hermes-agent#162784 ·
メンテナーはふだん 1 日以内に返信