Fixes 32021: Attach SQL to native Unity Catalog lineage edges - #33002
Closed
IceS2 wants to merge 2 commits into
Closed
Fixes 32021: Attach SQL to native Unity Catalog lineage edges#33002IceS2 wants to merge 2 commits into
IceS2 wants to merge 2 commits into
Conversation
IceS2
requested review from
a team,
ShaileshParmar11,
akashverma0786,
chirag-madlani and
karanh37
as code owners
September 9, 2026 05:27
Code Review ✅ ApprovedAttaches SQL statements to native Unity Catalog lineage edges by joining OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
ulixius9
approved these changes
Sep 9, 2026
13 tasks
Contributor
Author
|
Better approach here: #33141 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Describe your changes:
Fixes #32021
Native Unity Catalog lineage edges can currently appear without SQL even when the originating statement is available. Attach the latest readable statement for each source–target pair by joining
system.access.table_lineagetosystem.query.historyon statement and workspace IDs. Table edges and column mappings continue to come from native lineage.Enrichment runs in batches of 100 eligible edges across targets, schemas, and catalogs. Missing or redacted statements preserve native lineage; a history access failure disables enrichment for the rest of the run. Document the optional history permissions and SQL availability limits.
Type of change:
High-level design:
Batch only resolved edges that pass ingestion filters. Bind exact source–target pairs and return at most one SQL row per pair. This bounds enrichment batches and round trips, but does not bound warehouse scan bytes or change the existing native-lineage caches.
Tests:
ingestion/tests/unit/topology/database/test_unitycatalog_lineage_sql.py: 38 cases covering SQL selection, workspace isolation, missing/redacted history, batch boundaries across catalogs and schemas, filters, access failures, external lineage, and SDK backfill/update/preservation of stored SQL.lineage.py; full-module coverage is 68%.queries.pyis 100%. The tests execute joins, ranking, and bindings against SQLite with catalog/date syntax adapted; Databricks dialect compilation was checked separately.Manual testing performed:
INSERT ... SELECT. Ingested metadata and native lineage through the local UI.The bulk fixture stored the same whole
BEGIN ... ENDblock on its edges, so it verifies SQL presence and native mappings, not distinct expanded SQL per target. Distinct per-edge assignment is covered by automated tests. Warehouse scan cost was not measured.UI screen recording / screenshots:
Not applicable; only connector help text changed.
Checklist:
Fixes <issue-number>: <short explanation>.