Skip to content

Fixes #35755: resolve Unity Catalog upstreams across cross database services - #35756

Merged
Khairajani merged 8 commits into
mainfrom
fix-uc-cross-service-lineage
Oct 22, 2026
Merged

Khairajani merged 8 commits into
mainfrom
fix-uc-cross-service-lineage

Conversation

@Khairajani

@Khairajani Khairajani commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #35755

The Unity Catalog system tables cover the whole metastore, but the lineage source resolved an upstream only in its own serviceName and dropped the edge at DEBUG, so lineage from a table ingested under another service was lost behind a 100% success run.

  • With Process Cross Database Lineage on, an upstream missing from this service is looked up in Cross Database Service Names, in order (own service first).
  • A target is still resolved in this service only; the other service's own run emits edges ending in its tables.
  • Only a confirmed miss moves to the next service; a failed lookup stops the search, so a same-named table elsewhere never takes the edge.
  • An unresolved or failed upstream is a run-status warning, once per upstream.
  • Rule recorded in ADR:2026-10-19-unity-catalog-lineage-resolves-only-upstreams-across-services.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • Upstream in a cross database service links when the toggle is on; not searched when off or the list is empty
  • Own service wins over a cross database service; targets never resolve in another service
  • A failed own-service lookup does not fall through, and is warned
  • Unresolved upstream warns once

Unit tests

  • Updated test_unity_catalog_lineage.py, test_unitycatalog_self_referencing_lineage.py (Databricks/Unity Catalog unit tests: 721 passed)

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no Unity Catalog lineage integration suite; covered by unit tests and the e2e run below).

Manual testing performed

E2E against a real Databricks workspace and a fresh local OpenMetadata stack (2.0 server from a recent OSS branch; this PR has no server changes), real metadata ingest CLI:

  1. Wrote src.orders → dst.orders_copy → dst.orders_summary and other.refunds → dst.orders_refunds with CTAS; ingested schema src and dst as two Unity Catalog services (other not ingested).
  2. Ran the lineage agent of the dst service with Process Cross Database Lineage on and the src service listed. The test user had no system.access grant, so the lineage Databricks recorded for these writes (lineage-tracking API) was copied into tables with the system.access columns and the connector's SQL pointed at them; nothing else was changed.
Edge main this PR
src.orders → dst.orders_copy (other service) missing created, 2 column mappings
dst.orders_copy → dst.orders_summary (same service) created created
other.refunds → dst.orders_refunds (not ingested) dropped silently skipped with a warning
Run status 100%, 0 warnings 100%, 1 warning

UI screen recording:

Not applicable — ingestion-only change.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Decision check: the cross-service lookup rule is recorded under docs/decisions/.
  • I have added a test that covers the exact scenario we are fixing.

🤖 Generated with Claude Code


Summary by Gitar

  • Failed lookups:
    • A failed upstream lookup stops the search rather than falling through to a same-named table in another service
    • Failed upstream lookups are reported on the run status, once per upstream

This will update automatically on new commits.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new actionable issues were found.

Summary

Unity Catalog lineage can now find upstream tables in other configured services while keeping targets in the current service.

  • Unity Catalog lineage links upstream tables across configured services.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Resolve target in current service] --> B{Target found?}
  B -->|No| C[Skip edge]
  B -->|Yes| D[Look up upstream in current service]
  D --> E{Lookup result}
  E -->|Found| F[Emit edge with resolved columns]
  E -->|Request failed| G[Warn once and skip edge]
  E -->|Not found| H{Cross-service search enabled?}
  H -->|No| G
  H -->|Yes| I[Try configured services in order]
  I --> J{Lookup result}
  J -->|Found| F
  J -->|Request failed or all missing| G
Loading

Reviews (6) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

…ervices

The system tables cover the whole metastore, so an edge into this service
can start at a table another service ingested. Look the upstream up in
crossDatabaseServiceNames, in order, when processCrossDatabaseLineage is on,
and report an unresolved upstream as a run warning instead of a debug log.
@Khairajani
Khairajani requested a review from a team as a code owner October 19, 2026 14:10
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This 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 skip-pr-checks label.

@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

A failed request is not a miss: the table may exist in the service that
failed, and moving on would link a same-named table in a later service.
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

A lookup that fails now stops the search and is reported as a warning,
like an upstream no searched service holds, instead of a DEBUG log.
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@Khairajani Khairajani added the safe to test Add this label to run secure Github workflows on PRs label Oct 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@Khairajani
Khairajani added this pull request to the merge queue Oct 21, 2026
@Khairajani
Khairajani removed this pull request from the merge queue due to a manual request Oct 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — manual (2026-10-21T20:11:56Z)

The entry left the queue before it was built, so no checks ran against it.

@Khairajani
Khairajani enabled auto-merge October 21, 2026 20:13
@gitar-bot

gitar-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 closed / 2 findings

🟡 Medium risk · Unity Catalog now resolves upstream lineage across configured services, so ambiguous same-named tables could attach edges and column mappings to the wrong table.

Resolves Unity Catalog upstreams across cross database services by searching configured Cross Database Service Names when the toggle is on, with own service checked first. Failed upstream lookups now stop the search and report a run-status warning instead of dropping the edge silently at DEBUG, and the cross-service rule is recorded in a decision record. No open issues found.

✅ 2 closed
✅ Quality: Cross-service upstream-only resolution rule has no decision record

📄 ingestion/src/metadata/ingestion/source/database/unitycatalog/lineage.py:367-380 📄 ingestion/src/metadata/ingestion/source/database/unitycatalog/lineage.py:397-401 📄 ingestion/src/metadata/ingestion/source/database/unitycatalog/lineage.py:427-441 📄 ingestion/src/metadata/ingestion/source/database/unitycatalog/lineage.py:612-614
This PR gives processCrossDatabaseLineage and crossDatabaseServiceNames a new meaning for Unity Catalog. In the generic lineage_source.py, these fields trigger yield_cross_database_lineage. Here they become an ordered list of services to search for an upstream. Edge coverage now also depends on a rule that no single file shows: each service's own lineage run is the only thing that emits edges ending in its tables. The description says: "A target is still resolved in this service only; the other service's own run emits edges ending in its tables" and "look[ed] up in Cross Database Service Names, in order (own service first)". Nothing in docs/decisions/ records this, and it has to hold across pipelines. For example, an A→B edge only appears if B's run lists A, so the setup must be symmetric.

The record would say: "Unity Catalog lineage resolves a target only in its own service. An upstream is looked up in its own service first, then in crossDatabaseServiceNames in configured order, and only when processCrossDatabaseLineage is on. Each service's lineage run is responsible for the edges ending in its tables. An upstream that no searched service holds is reported once per run as a status warning."

✅ Edge Case: Failed upstream lookup drops the edge silently at DEBUG

📄 ingestion/src/metadata/ingestion/source/database/unitycatalog/lineage.py:616-620 📄 ingestion/src/metadata/ingestion/source/database/unitycatalog/lineage.py:640-642
Before this commit, a failed request in _get_table_by_entity_fqn returned None, so the upstream ended up at _report_unresolved_upstream and showed as a warning. Now _find_table raises any non-404 APIError or connection error, and in _process_table_lineage that exception goes to the generic except Exception at lines 640-642. That handler only logs at DEBUG. So an upstream whose lookup hits a timeout, 5xx or connection reset loses its edge, and the run still reports 100% success. That is the silent loss this PR was written to fix. Catching the failure around _find_table and reporting it on the status, as a warning or failure, would keep the new no-fall-through behaviour and still surface the lost edge. The new test test_a_failed_own_service_lookup_does_not_fall_through_to_another_service could also assert that this is reported.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@Khairajani
Khairajani added this pull request to the merge queue Oct 21, 2026
@sonarqubecloud

Copy link
Copy Markdown

Merged via the queue into main with commit 5f72d9a Oct 22, 2026
83 of 86 checks passed
@Khairajani
Khairajani deleted the fix-uc-cross-service-lineage branch October 22, 2026 01:17
Khairajani added a commit that referenced this pull request Oct 22, 2026
…ervices (#35756) (#35919)

* Fixes #35755: resolve Unity Catalog upstreams across cross database services

The system tables cover the whole metastore, so an edge into this service
can start at a table another service ingested. Look the upstream up in
crossDatabaseServiceNames, in order, when processCrossDatabaseLineage is on,
and report an unresolved upstream as a run warning instead of a debug log.

* docs: record the Unity Catalog cross-service upstream rule

* ingestion: cite the cross-service upstream decision record

* ingestion: stop the upstream search on a failed lookup

A failed request is not a miss: the table may exist in the service that
failed, and moving on would link a same-named table in a later service.

* ingestion: report a failed upstream lookup on the run status

A lookup that fails now stops the search and is reported as a warning,
like an upstream no searched service holds, instead of a DEBUG log.

* ingestion: prune the G004 baseline entry the lineage change removed

(cherry picked from commit 5f72d9a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unity Catalog lineage silently drops edges whose upstream table is in another database service

2 participants