Repository navigation
fix(unitycatalog): remove databaseSchema from the Unity Catalog connection - #38180
akashverma0786 wants to merge 5 commits into
Conversation
The Unity Catalog source always listed every schema and never read databaseSchema; only Test Connection used it to pick the schema it probes. Remove it from unityCatalogConnection.json. Test Connection now probes the first schema the catalog lists, and schemaFilterPattern selects schemas. The 2.1.0 migration strips connection.config.databaseSchema from Unity Catalog services, their version snapshots and saved Test Connection requests on MySQL and Postgres, so stored rows keep loading under additionalProperties: false. Databricks connections are left alone.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
Local Java test run: PASSED — details
Tests run locally
Broader coverage not executed by this focused run
Why these tests
Impacted, not run locally (1)
Commandsmvn -B package -pl openmetadata-service -am -Dspring-boot.repackage.skip=true -Dtest=NestedSecretConverterCoverageTest -Dsurefire.failIfNoSpecifiedTests=false |
…atements DataAssetChartScopeSqlMigrationTest read the 2.1.0 script from its section marker to the end of the file, so any statement appended after the section, such as the Unity Catalog databaseSchema cleanup, was counted as its own. The section now ends with its last chart UPDATE.
…equests in id batches Nothing indexes a saved request's connection type, so the single SQL update read all of automations_workflow at once. A v210 data migration now walks the table with IdBatches, 500 ids at a time, and removes the key from Unity Catalog requests only. It runs once, recorded as a data migration step. Services and their version snapshots stay in the 2.1.0 SQL.
…ve-databaseschema # Conflicts: # openmetadata-service/src/main/java/org/openmetadata/service/migration/mysql/v210/Migration.java # openmetadata-service/src/main/java/org/openmetadata/service/migration/postgres/v210/Migration.java
Code Review ✅ Approved 🔴 High riskRemoving Unity Catalog’s databaseSchema from the public connection schema and migrating stored records is a breaking interface change; old workflows could fail validation. Removes the unused VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
| IdBatches.fold( | ||
| handle, | ||
| TABLE, | ||
| 0, | ||
| (sum, batch) -> sum + handle.createUpdate(update).bindList(IDS_BIND, batch).execute()); |
There was a problem hiding this comment.
Test Connection history stops loading
Updating a workflow saves its previous request in entity_extension under workflow.version.*. This migration only repairs automations_workflow, and the new SQL only repairs databaseService.version.*.
After upgrading, reading an affected workflow version or listing its history still sends databaseSchema through UnityCatalogConnectionClassConverter, which rejects the removed field. Repair the workflow snapshots on both databases too, using an indexed lookup.
Knowledge Base Used: Metadata schema contracts
Describe your changes:
No linked issue: found by a live audit of the Unity Catalog connector against a Databricks workspace.
databaseSchemaon the Unity Catalog connection restricts nothing.schemas.listand never read the field. Only Test Connection did, from fix(ingestion): improve Unity Catalog test-connection step quality #28647 on, to pick the schema its probes use.databaseSchema: qa_uc_pgand filter^qa_uc_(a|pg)$ingested both schemas (18 + 59 tables).Fix: remove the field.
unityCatalogConnection.jsonno longer hasdatabaseSchema. Schemas are selected withschemaFilterPattern, which ingestion applies.additionalProperties: false, so a stored row that still carries the key would stop loading: the server rejects it withUnrecognized field "databaseSchema"and ingestion withextra_forbidden. The 2.1.0 migration removesconnection.config.databaseSchemafrom every stored copy, on MySQL and Postgres: SQL repairs Unity Catalog services and theirdatabaseService.version.*snapshots, and the data migrationUnityCatalogDatabaseSchemaMigrationrepairs saved Test Connection requests in id batches. Databricks connections keep their owndatabaseSchema, so every step is scoped to Unity Catalog. New record:ADR:2026-11-19-unity-catalog-connections-have-no-database-schema.Behavior changes to note in the release:
databaseSchemaon a Unity Catalog connection fails validation (Extra parameter 'databaseSchema') and must drop the key; useschemaFilterPattern: {includes: ["^<schema>$"]}to ingest one schema. Services stored in OpenMetadata are repaired by the migration.Type of change:
High-level design:
yarn parse-schemaoutput:public/jsons/...andsrc/jsons/ingestionSchemas/...) and the TypeScript type (json2ts.sh). Only the hunks that remove this field are kept: the generators also rewrite unrelated$refpaths and drop license headers in files they touch.2.1.0/{mysql,postgres}/postDataMigrationSQLScript.sql, the release in progress, as thesampleDataStorageConfigand Microsoft FabricclientSecretremovals there do. Each is idempotent (it matches only rows that still carry the key). The snapshot statement joinsdbservice_entityon the service id, the leading primary-key column ofentity_extension, so version history is not scanned.automations_workflowwithIdBatches(500 ids per batch, keyset on the primary key,ADR:2026-10-09-data-migration-backfills-walk-ids-in-batches) and updates only the Unity Catalog requests of each batch. It runs once throughrunOnce, recorded as a data migration step.DataAssetChartScopeSqlMigrationTestread the 2.1.0 script from its section marker to the end of the file, so it counted statements appended after its section as its own. Its section now ends with its last chart statement.schemaFilterPattern, and a cleanup scoped to one schema can then delete live sibling schemas.Tests:
Use cases covered
schemas.list().null, no key), their version snapshots and Test Connection requests lose the key and keep every other field; Databricks rows and unrelated extension rows keep theirs; a second run changes no row.Unit tests
UnityCatalogDatabaseSchemaMigrationTest, against real MySQL 8.0 and PostgreSQL 15 containers. Fixed:DataAssetChartScopeSqlMigrationTestbounds its section.unitycatalog/test_connection.py(the configured-schema test now checks the listed schema),test_unity_catalog_connection.py(the configured-schema test is removed), and the fixtures oftest_unity_catalog.py,test_unity_catalog_lineage.pyandtest_unitycatalog_error_isolation.py, which set the removed key.584 passed; the 1 collection error istest_source_connection.py, which imports drivers missing from the local venv (trino,oracledb). Its Unity Catalog URL tests do not set the field and fail the same way locally onmain.ruff check/ruff format --checkclean;basedpyrightonunitycatalog/connection.py: 0 errors.Backend integration tests
LIKEthe OpenMetadata ones, and PostgreSQL 16 tables with the bootstrap DDL.EXPLAINusesPRIMARY(MySQL) andentity_extension_pkey(PostgreSQL) for the snapshot statement.UnityCatalogConnectionPOJO, built from this branch, loads a migrated row and rejects an unmigrated one withUnrecognized field "databaseSchema";DatabricksConnectionstill loadsdatabaseSchema.UnityCatalogDatabaseSchemaMigrationTest, every test that reads or parses the 2.1.0 script, the v210Migrationtests andNestedSecretConverterCoverageTest, which walksUnityCatalogConnectionClassConverter: 102 tests passed.Local Java test run: PASSED
d7b5c208140b(baseorigin/main) — uncommitted changes were present--scope full).Ingestion integration tests
tests/integration/suite for Unity Catalog. Real ingestion runs are listed below.Playwright (UI) tests
Manual testing performed
Real
metadata ingestruns against a live Databricks workspace and a local OpenMetadata server, on one fresh service:maincode withdatabaseSchema: qa_uc_pgstored on the service. Both schemas ingested (18 + 59 tables).extra_forbiddenatUnityCatalogConnection.databaseSchema.databaseSchemastill in the YAML: fails withExtra parameter 'databaseSchema'.openmetadata-ops.sh migratefrom this branch's build on a MySQL database that had already run 2.1.0 without this change, holding a Unity Catalog service with the key, its snapshot and 1,105 saved requests (3 Unity Catalog with the key across three batches, 1 Databricks with it): 2.1.0 is reprocessed, the service and snapshot lose the key, the data migration logsRemoved databaseSchema from 3 saved Unity Catalog Test Connection request(s), the Databricks request keeps it. A secondmigrateskips the step and changes nothing.UI screen recording:
Not applicable: a connection field removed from a generated form.
Checklist:
Fixes <issue-number>: <short explanation>: no issue, found by a live connector audit.Fixes #<issue-number>above: same.REVIEW.md(migrations: both engines, idempotent, index-usableentity_extensionpredicate, snapshots rewritten, legacynullhandled, the growingautomations_workflowwalked in id batches).docs/decisions/2026-11-19-unity-catalog-connections-have-no-database-schema.md.The PR should not merge until the existing workflow-history finding is fixed.
Findings
Summary
Removes the unused
databaseSchemaconnection field from Unity Catalog.databaseSchema.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Unity Catalog schema drops databaseSchema] --> B[Generated models and connection forms] C[Upgrade] --> D[SQL cleans services and service versions] C --> E[Java walks saved requests in ID batches] F[Test Connection] --> G[List schemas] G --> H[Probe first named schema]Reviews (6) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile