Repository navigation
[2.0] Fixes #37803: MicroStrategy column-level lineage from cube SQL to data models - #37945
Conversation
…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)
❌ 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 |
Code Review ✅ Approved 🟡 Medium riskAdding 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 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 |
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 caches2.0already has from #37855. The connector code is identical tomain.Plus one commit from the bot review: Data Import objects that share a name get no column edge. The same commit is on
mainin #37948.Type of change:
Tests:
mainagainst a MicroStrategy trial (BigQuery) and the public demo.Checklist:
[2.0] Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.🤖 Generated with Claude Code


Confidence 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.
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| TableOnlyReviews (7) · Last reviewed commit: "MicroStrategy: link no column to Data Im..." · Reviewed by Greptile