Oracle engine adapter: scope proposal before implementation
Maintainer thường phản hồi trong vòng 4 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 15/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 3.3k
- Fork
- 471
- Merge trung bình
- 6 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 35
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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 SQLMesh/sqlmesh
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
SQLMesh/sqlmesh#6008 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
VSCode Extension: SQLMesh LSP crashes on startup: ImportError: cannot import name 'WorkspaceDiagnosticRefreshRequest' with lsprotocol 2025.xCó thể đã có người làm @boomesh11 đã nhận 15 ngày trước. Đang mởBug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Improvement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
SQLMesh/sqlmesh#5696 · 6 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của SQLMesh/sqlmesh
Issue tương tự
-
[BUG][Low–Medium] founder_numbers.py silently reads a SAFE discount or pool target given as a fraction (0.2) as 0.2%Có thể đã có người làm @sumitkhond111-del đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
bmad-code-org/BMAD-METHOD#3358 · 1 bình luận ·
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 86/100
open-mmlab/mmcv#3352 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
OpenGithubs/weekly#263 ·
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 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
comp/cli P3 type/feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
NousResearch/hermes-agent#162784 ·
Maintainer thường phản hồi trong vòng 1 ngày