Skip to content

[2.0] Fixes #37803: MicroStrategy column-level lineage from cube SQL to data models - #37945

Merged
Khairajani merged 2 commits into
2.0from
mstr-column-lineage-2.0
Nov 17, 2026
Merged

Khairajani merged 2 commits into
2.0from
mstr-column-lineage-2.0

Conversation

@Khairajani

@Khairajani Khairajani commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #37803

Backport of #37804 to 2.0: MicroStrategy column-level lineage from cube SQL to data models. A cherry-pick of the merged commit; the conflicts were only imports and cache fields next to the bounded caches 2.0 already has from #37855. The connector code is identical to main.

Plus one commit from the bot review: Data Import objects that share a name get no column edge. The same commit is on main in #37948.

Type of change:

  • Improvement

Tests:

Checklist:

  • My PR title is [2.0] Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have added tests and listed them above.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; the duplicate-name issue is fixed and no new blocking issues were found.

Summary

Adds column-level lineage from MicroStrategy cube SQL to data models.

  • MicroStrategy schema cubes link source columns to matching model attributes.
  • Data Import cubes link objects to source columns with matching names.

The earlier, unnumbered “Duplicate names get wrong links” finding is fixed. Objects with different IDs but the same case-folded name are now rejected before exact matching. A regression case covers this behavior. No new actionable issues or repository-rule violations were found.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  SQL[Cube SQL] --> Read[Read source tables and columns]
  Read --> Tables[Find OpenMetadata tables]
  Tables --> Match{Cube type}
  Match -->|Schema cube| Forms[Match attribute forms]
  Match -->|Data Import| Names[Match unique object names]
  Forms --> Edge[Table edge with supported column pairs]
  Names --> Edge
  Forms -->|Column lookup fails| TableOnly[Keep table edge without column pairs]
  Names -->|No clear match| TableOnly
Loading

Reviews (7) · Last reviewed commit: "MicroStrategy: link no column to Data Im..." · Reviewed by Greptile

…a models (#37804)

* MicroStrategy: skip documents, parse cube SQL once, dedupe columns

- Tell Report Services documents, templates and themes from dossiers by
  viewMedia (the rule MicroStrategy's mstrio-py SDK uses) and skip them
  before reading a definition the dossier API cannot serve.
- Parse each cube's SQL once per cube and dialect instead of once per
  dbServicePrefixes entry and dossier; skip a prefix whose database does
  not match the table's qualifier.
- Give repeated data model column names a suffix, and drop a repeated object.
- Say when a dataset is a report rather than a cube.

* MicroStrategy: suffix repeated column names in id order

A dataset can list its objects in another order on a later run; suffixes
given in listing order would then move a column name to another object.

* MicroStrategy: column-level lineage from cube SQL to data models

Data model columns are matched on the warehouse columns each projection of
the cube SQL reads, not on MicroStrategy's generated aliases: schema
attributes through their form expressions (modeling API), Data Import
objects through the names the import derives from columns. Metrics of
schema cubes get no column edge.

* MicroStrategy: compare every table qualifier in column lineage

Two tables sharing a name in different schemas or projects could be linked
to each other's columns. Forms name their physical table as the SQL does
(table prefix, else namespace), a 403 alone means missing privileges,
and a column parse failure keeps the table list.

* MicroStrategy: cache an unreadable schema attribute and warn once

* MicroStrategy: link schema attribute column lineage to the attribute column

The lineage view draws no edge to a nested data model column, so pairs that
targeted an attribute form (Order.ID) were stored but never shown.

* MicroStrategy: tighten column lineage matching from review

Data Import objects match the column of the same name, else one unique
normalized match that keeps letters of every script; nested queries
resolve columns against their own aliases; comment-led passes are read;
a refused table read stops modeling calls like a refused attribute read.

* MicroStrategy: bound the service lookup caches

The dialect and database-name caches are now LRUs capped at CACHE_SIZE,
like the connector's other caches, and database names are read with
model_str.

* MicroStrategy: skip leading SQL comments without a backtracking regex

A repeated comment group in a regex backtracked exponentially on an
unclosed /* (CodeQL). Comments are now skipped by a linear scan, and
passes are split on blank lines, then rejoined where no statement starts.

* MicroStrategy: split cube SQL passes in one scan and resolve correlated columns

Passes split on a blank line before a statement, never inside a comment
or quoted text; an unclosed comment ends the scan without swallowing the
pass before it. A correlated column resolves against enclosing queries
when its own query has no such alias. An object listed twice in a dataset
counts once for name matching.

* MicroStrategy: stop alias lookups at derived tables and honour dialect escapes

An alias a query defines as a derived table ends the lookup there, so it
never resolves to a same-named outer table. Quoted text in the pass split
honours backslash escapes in the dialects sqlglot reads them in, and its
end is found by a forward scan, so an unclosed string stays linear.

---------

Co-authored-by: Pablo Takara <[email protected]>
(cherry picked from commit b2c8af2)
@Khairajani
Khairajani requested review from a team as code owners November 17, 2026 06:26
@Khairajani Khairajani added the safe to test Add this label to run secure Github workflows on PRs label Nov 17, 2026
@Khairajani
Khairajani requested review from mohittilala and removed request for a team November 17, 2026 06:26
@Khairajani Khairajani added the safe to test Add this label to run secure Github workflows on PRs label Nov 17, 2026
@Khairajani
Khairajani requested review from ShaileshParmar11 and removed request for a team November 17, 2026 06:26
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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.

@gitar-bot

gitar-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Adding MicroStrategy column-lineage mappings could associate incorrect warehouse columns with data-model fields, misleading users about data provenance.

Backports the MicroStrategy column-level lineage from cube SQL to data models to 2.0, with only import and cache-field conflicts resolved against the existing bounded caches. No issues found.

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 merged commit 218f2c3 into 2.0 Nov 17, 2026
68 of 75 checks passed
@Khairajani
Khairajani deleted the mstr-column-lineage-2.0 branch November 17, 2026 08:06
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.

2 participants