Oracle engine adapter: scope proposal before implementation
Maintainer antworten meist innerhalb von 4 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 15/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 3.3k
- Forks
- 471
- Ø Merge
- 6 T. 7 Std.
- Gemergte PRs (30 T.)
- 35
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus SQLMesh/sqlmesh
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
Maintainer antworten meist innerhalb von 4 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 4 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
SQLMesh/sqlmesh#6008 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 4 Tagen
-
VSCode Extension: SQLMesh LSP crashes on startup: ImportError: cannot import name 'WorkspaceDiagnosticRefreshRequest' with lsprotocol 2025.xEvtl. vergeben @boomesh11 hat das vor 15 Tagen übernommen. OffenBug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
Maintainer antworten meist innerhalb von 4 Tagen
-
Improvement
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
SQLMesh/sqlmesh#5696 · 6 Kommentare ·
Maintainer antworten meist innerhalb von 4 Tagen
Alle Issues in SQLMesh/sqlmesh
Ähnliche Issues
-
[BUG][Low–Medium] founder_numbers.py silently reads a SAFE discount or pool target given as a fraction (0.2) as 0.2%Evtl. vergeben @sumitkhond111-del hat das heute übernommen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
bmad-code-org/BMAD-METHOD#3358 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
open-mmlab/mmcv#3352 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 68/100
OpenGithubs/weekly#263 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
comp/cli P3 type/feature
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
NousResearch/hermes-agent#162784 ·
Maintainer antworten meist innerhalb von 1 Tag