ISSUE-25600: Add support for ingesting Oracle Global Temporary Tables#27528
ISSUE-25600: Add support for ingesting Oracle Global Temporary Tables#27528kratipaliwal wants to merge 1 commit intoopen-metadata:mainfrom
Conversation
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Code Review ✅ ApprovedIntegrates Oracle Global Temporary Table ingestion support into the pipeline. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|
|
🟡 Playwright Results — all passed (19 flaky)✅ 3668 passed · ❌ 0 failed · 🟡 19 flaky · ⏭️ 89 skipped
🟡 19 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |



ISSUE-25600: Add support for ingesting Oracle Global Temporary Tables
Summary
Oracle Global Temporary Tables (GTTs) have permanent definitions in the data dictionary (
*_TABLES.DURATIONisSYS$SESSIONorSYS$TRANSACTION); only their data is session-scoped. Despite being introspectable like any regular table, the Oracle connector filtered them out unconditionally viaAND DURATION IS NULLinORACLE_GET_TABLE_NAMES, so they never appeared in OpenMetadata.This PR adds an opt-in
includeTemporaryTablesboolean toOracleConnection. When enabled, GTTs are fetched via a newORACLE_GET_TEMPORARY_TABLE_NAMESquery and surfaced withTableType.Localso users can distinguish them from regular tables in the UI.This mirrors the spirit of Snowflake's
enableTempTableLineageflag — opt-in, defaults to off, preserves existing behavior.Why GTTs (and not, e.g., Snowflake temp tables)
Oracle GTTs are fundamentally different from Snowflake temporary tables:
ALL_TABLES/ALL_TAB_COLSfor any session. Only the row data is session-scoped.So Oracle GTTs can be ingested cleanly using the existing reflection paths — no extra plumbing needed for columns, constraints, or comments.
Changes
Schema (
openmetadata-spec/.../oracleConnection.json)includeTemporaryTables: booleanproperty (defaultfalse).Connector (
ingestion/.../oracle/)queries.py— newORACLE_GET_TEMPORARY_TABLE_NAMESconstant (same shape as the regular query butDURATION IS NOT NULL). OriginalORACLE_GET_TABLE_NAMESleft untouched, so default behavior is unchanged.utils.py— newget_temporary_table_names(dialect, connection, schema)helper. Keptget_table_names's SQLAlchemyInspectorcontract intact.metadata.py—query_table_names_and_typesnow appends GTTs asTableType.Localentries when the flag is set. Read defensively viagetattrso it's safe even before model regeneration.Tests
Unit (
ingestion/tests/unit/topology/database/test_oracle.py)test_temporary_tables_query_filters_on_duration_not_null— sanity check on the SQL constants.test_default_excludes_temporary_tables— verifies no GTT fetch andengine.connectnot called when flag off.test_include_temporary_tables_yields_local_type— verifies GTTs come back asTableType.Localand the executed query targetsDURATION IS NOT NULL.Integration (
ingestion/tests/integration/oracle/) — new modulegvenzl/oracle-free:23-slim-faststarttestcontainer.test_gtts_excluded_by_default— flag off ⇒ regular table present, GTTs absent.test_gtts_ingested_when_flag_enabled— flag on ⇒ regular + both GTTs present.test_gtts_carry_local_table_type— GTTs surface asTableType.Local, regular asTableType.Regular.test_gtt_columns_are_ingested— column reflection works for GTTs.metadata.delete(... recursive=True, hard_delete=True)after the package finishes.Backward compatibility
false, so behavior for existing Oracle services is unchanged on upgrade.trueonly adds entities to the service; it does not modify or remove anything previously ingested.falselater will leave previously-ingested GTT entities in OpenMetadata as orphans (they simply stop being refreshed). Standard re-ingest / soft-delete handling applies.Reproducing
Sample DDL the integration test uses (paste into
sqlplusor any Oracle client):Verify they're flagged as temporary in the data dictionary:
Test plan
pytest ingestion/tests/unit/topology/database/test_oracle.py)pytest ingestion/tests/integration/oracle/against a running OpenMetadata instance with Docker available)includeTemporaryTables: true, verify GTTs appear in the UI tagged asLocalmake generateregenerates the Pydantic + Java models cleanly from the updated JSON schemaCloses
Closes #25600