Repository navigation
Conversation
Adds an aliases[] array of alternate fully-qualified SQL names (e.g. SQL Server synonyms) to Table and CreateTableRequest, so a synonym can be recorded on the canonical table it resolves to instead of creating a second entity.
…digests Source hash should be stable regardless of alias list ordering, since sys.synonyms in MSSQL provides no row ordering guarantee. This change sorts the aliases list before hashing to ensure consistent digest generation across ingestion runs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…fiers Implement split_sql_server_identifier() for bracket-aware T-SQL identifier splitting and parse_base_object_name() to normalize synonym base_object_name into a three-part target (database.schema.table), with handling for missing parts (defaulting schema to 'dbo' and database to the synonym's database), remote references, and edge cases. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Add SynonymMap class to track SQL Server synonyms with bounded memory usage and consumption tracking. Implements the following: - MAX_SYNONYM_ENTRIES: bounded cache with 5000-entry default cap - add(): stores aliases by target, rejects new targets beyond cap - aliases_for(): returns sorted aliases and marks target consumed - record_unresolved(): explicitly records unresolved synonyms - unresolved(): reports both explicit and unconsumed targets - is_empty(): checks if the map contains any entries Includes 9 unit tests covering all core behaviors and edge cases: alias sorting, deduplication, cap enforcement, consumption tracking, and unresolved reporting. All 29 tests (20 existing + 9 new) pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…de effect Finding 1 (Critical): _explicit_unresolved is now capped at max_entries to prevent unbounded memory growth on catalogs with many malformed synonyms. Uses a separate warn-once flag _unresolved_cap_warned to avoid silencing target-cap warnings. Finding 2 (Minor): aliases_for method now has a docstring documenting that calling it marks the target consumed and signals successful ingestion. This establishes the contract for the "call exactly once per table" expectation. Includes new test test_unresolved_cap_bounds_explicit_entries verifying the cap applies correctly to record_unresolved calls. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…liases docstring and add wiring test
Sweeps sys.synonyms across every in-scope database in MssqlSource.prepare() (before the topology produces anything), builds a target FQN -> alias FQNs map, and resolves each table's aliases by construction via a get_table_aliases override. close() reports synonyms that never resolved to an ingested table.
…prepare Adds coverage for the keystone routing logic that decides which databases prepare() sweeps for synonyms: the ingestAllDatabases=False short-circuit, databaseFilterPattern exclusion, prepare() wiring build_synonym_map's result into self.synonym_map, and prepare()'s resilience path leaving a usable empty SynonymMap (not None) when the sweep raises.
… entity TableMapper.createToEntity never copied create.getAliases() onto the Table it builds, so the aliases field added in the Table/CreateTable schema (feat(spec): add source-managed aliases field to Table entity) was silently dropped on both POST and PUT: it could never reach the entity to be created, updated, replaced, or merged in the first place. Discovered while writing the Task 9 integration test for the mssql synonym-aliases design (out of that task's stated file scope, but a blocking prerequisite for it to test anything at all).
…ly drop changes TableUpdater.entitySpecificUpdate never registered "aliases" with recordChange, so a PUT that changed only aliases produced no field diff: entityChanged/versionChanged stayed false and storeUpdate() skipped persisting the new version entirely. The PUT response still echoed the caller's in-memory Table (with the new aliases), masking that the database row kept the stale value — confirmed by re-fetching the entity after the PUT in the Task 9 integration test. Registering aliases here, alongside the other plain-field recordChange calls, makes updateVersion() see the change and persist it, so a PUT with a new aliases list replaces the array wholesale (matching default List<String> semantics) instead of being ignored. This is required for the mssql synonym design's "the connector resends the full list every run, no diffing needed" property to hold.
Gate on the mssql synonym-aliases design assumption that a PUT CreateTable with a full aliases list replaces the array wholesale, so created/dropped/retargeted synonyms reconcile through plain upsert semantics with no diffing stage. Covers initial set, retarget (old alias gone), and clear (empty list clears aliases), re-fetching the entity after each PUT rather than trusting the mutation response's in-memory echo. Running it against unpatched code (git stash the two preceding fix commits) confirmed the assumption did NOT hold by default: aliases never reached the entity at all (TableMapper gap), and once that was fixed, a retarget silently failed to persist (TableUpdater gap) while the PUT response still reported the new value. Both gaps are fixed in the two preceding commits; default array replace semantics were not sufficient on their own.
recordChange compares aliases with List::equals, which is order-sensitive and does not normalize null against empty. GlossaryTerm.synonyms (also a List<String> of alternate names) already uses recordListChange with listOrEmpty normalization for exactly this reason; Topic.cleanupPolicies follows the same pattern. Two concrete problems with recordChange here: - Order churn: ["b","a"] vs ["a","b"] would record as a change, bumping the table's version and firing a change event on every re-ingestion even when the alias set is unchanged. This was only masked by SynonymMap.aliases_for returning a sorted list, making the server contract silently depend on every producer sorting. - Null/empty asymmetry: original=null, updated=[] took the "orig == null" branch and recorded a fieldAdded, bumping the version for a table whose alias set went from nothing to nothing. Switch to recordListChange with listOrEmpty-normalized inputs and stringMatch, following GlossaryTermRepository.updateSynonyms exactly. Verified via TableResourceIT#put_tableAliases_replaceNotMerge that all three transitions (set, retarget, clear) still replace wholesale: retarget now records added+deleted, clear records deleted, and each correctly marks entityChanged so the new version persists.
…r value Two fixes to put_tableAliases_replaceNotMerge from review: - The initial-set leg only asserted on the create response (the in-memory echo of the request), not on a re-fetched entity, so it proved echo rather than persistence. A mapper that wired aliases into the create path but dropped them at store time would have passed this leg while legs 2/3 (which do re-fetch) still passed via the original=null -> fieldAdded path on the first PUT. Added an explicit re-fetch assertion so the create path is actually covered. - The clear leg sent aliases=[] and accepted either null or empty back. Now that aliases uses recordListChange (previous commit), the persisted value is deterministic, so assert on it directly. Changed the leg to send aliases=null instead of aliases=[], matching what SynonymMap.aliases_for (ingestion/src/metadata/ingestion/source/database/mssql/synonyms.py) actually returns on a miss (None, not an empty list) -- this is the production clear path the mssql connector takes, not a hypothetical one.
Add es_search_from_alias to the ES mixin and a fallback in search_table_entities so lineage resolves a source-managed alias (e.g. a SQL Server synonym) to the canonical table it points at. Generic, service-agnostic: works for any connector that populates Table.aliases, without depending on connector-specific in-memory state.
Adds a TableAliases widget that lists a table's source-managed alternate FQNs (e.g. SQL Server synonyms) on the table detail page. Display-only by design: the MSSQL connector recomputes and overwrites aliases on every run, so an edit control would silently discard user input. Also regenerates the UI's TS types for Table/CreateTable/BulkCreateTable from the JSON Schema to pick up the aliases field added in a prior schema change; the previous change updated only the schema, never the generated UI types (make update_typescript_types), leaving Table.aliases absent from the frontend contract. Verified the regeneration touched only the aliases addition with no unrelated churn. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Creates a table with source-managed aliases via the API, visits its page, and asserts the display-only widget renders each alias and offers no edit control (the connector overwrites aliases on every ingestion run, so an editable field would silently discard input). Also covers the negative case: a table with no aliases renders no widget at all.
- common_db_source.py: wrap get_table_aliases() strings in FullyQualifiedEntityName before assigning to CreateTableRequest.aliases, which is invariantly typed list[FullyQualifiedEntityName] | None. - source_hash.py: cast the result of _remove_volatile_fields to dict[str, Any] before the new "aliases" sort block indexes it by string key; narrows the same union for the pre-existing columns/tags/ tableConstraints/owners blocks too, so their baselined errors also clear (baseline.json untouched -- discard mode tolerates unused entries). - sql_lineage.py: inline-suppress the new search_cache.put(search_tuple, ...) call with a narrow pyright:ignore, matching the pre-existing baselined call a few lines above -- LRUCache.put's `key: str` annotation is too narrow for the tuple keys this cache actually uses everywhere. make static-checks now reports zero errors attributable to this branch.
…us MagicMock matches search_table_entities' Task-10 alias fallback treats any truthy return from metadata.es_search_from_alias as a resolved alias. TestDbUtils.setUp builds a bare MagicMock() metadata client; any test that reaches the fallback without stubbing this call gets an unconfigured, auto-truthy MagicMock back instead of None, which the fallback short-circuits on and returns as if it were real Table entities -- breaking test_get_view_lineage_success_with_fallback, whose schema-fallback scenario reaches this exact branch. es_search_from_alias's real contract is Optional[List[Table]]; production code has no bug here since a real client only ever returns that shape. The gap is purely a missing test stub, so the fix is stubbing it (return None) once in setUp, covering every test in the class the same way es_search_from_fqn and get_by_name are already stubbed, rather than papering over it per-test. Audited every other MagicMock-metadata test in tests/unit/lineage, tests/unit/test_db_utils.py, and tests/unit/topology that exercises search_table_entities/get_table_entities_from_query/get_view_lineage without mocking the function away entirely (test_cross_database_lineage_sql.py, test_stored_procedure_lineage.py, test_grafana.py, test_hex_lineage.py, test_snowflake_access_history_lineage.py, test_dbtcloud.py): none reach the alias-fallback branch today (confirmed by temporary instrumentation), so no other test file needed a stub.
Verified against a real SQL Server 2022 instance: sys.synonyms.base_object_name preserves the exact casing typed in CREATE SYNONYM ... FOR ..., never the target object's actual stored casing. Under SQL Server's default case-insensitive collation this is routine (CREATE SYNONYM dbo.o FOR analytics_master.dbo.Orders against a table stored as "orders" is completely normal T-SQL), but SynonymMap's dict/set lookups were case-sensitive Python string comparisons, so the alias silently missed its target and got reported as an unresolved synonym even though the target exists and was ingested -- defeating the feature's primary use case of cross-database synonyms. Fix: _targets is now keyed on target_fqn.casefold() in add()/aliases_for(); _consumed stores the same folded key so a target consumed via a differently cased lookup is correctly excluded from unresolved(). Alias FQN values are never folded -- OpenMetadata FQNs are case-preserving, so aliases[] must keep the source's original casing. Bounded caps and warn-once flags on both _targets and _explicit_unresolved are untouched. Added 3 tests to TestSynonymMap covering case-insensitive lookup in both casing directions, original-case preservation of the returned alias, and consumption-tracking correctness across a case mismatch; all pre-existing exact-case tests continue to pass unmodified.
I1: the aliases field was added to the search document and to searchSettings.allowedFields, but neither is consulted when building the actual Explore query -- ElasticSearchSourceBuilderFactory builds data-asset queries solely from assetTypeConfigurations[table].searchFields, which never listed aliases. Searching an alias FQN therefore returned zero results, contradicting the design spec's search guarantee. Add aliases (boost 5.0, standard match, mirroring TableIndex's intended columns.name weight) and aliases.keyword (boost 10.0, exact match, for FQN-precise ranking) to the table searchFields, and aliases to highlightFields so a match actually produces highlight fragments. Also remove TableIndex.getFields()'s dead "aliases" boost entry -- getFields() has zero production callers for TableIndex, so the entry did nothing -- and replace the vacuous test that asserted on it with one that asserts against the settings-driven path search actually uses.
I2: searchSettings.json is seed data merged additively on startup -- only whole missing asset types get added to an already-installed instance's stored settings, so upgraded clusters would keep their old table entry forever and never pick up the aliases searchField/ highlightField from the previous commit. Alias search would work on fresh installs but stay broken on every upgrade. Add v210.MigrationUtil.addAliasesSearchSettings(), following the get/load/merge/save/log skeleton from v200's backfillSearchRankingSettings() and the hand-rolled boolean-returning merge-helper pattern from v1132/v11210's search-settings fixes. Idempotent. Neither mysql/v210/Migration.java nor postgres/v210/Migration.java existed yet (2.1.0's data migration was SQL-only so far), so both are added here to carry the call -- migration class resolution is purely reflective on the version-derived package name.
M1: fullyQualifiedName's keyword has no ignore_above, and the schema permits FQNs up to 3072 chars, but aliases.keyword was capped at 256 -- an alias FQN longer than that is silently dropped from the index with no diagnostic, and es_search_from_alias can never resolve it. SearchIndexSettings.harden() already backfills ignore_above on any keyword field lacking one, using the dynamically computed safe char threshold (well above 3072) -- the same mechanism fullyQualifiedName relies on -- so removing the static cap does not leave the field unbounded. Applied identically to all four locale mapping files.
M4: "if table_entities: return table_entities" two lines above the alias-fallback block already guarantees table_entities is empty by the time "if not table_entities:" is reached, so the guard was always true. Drop it and de-indent; no behavior change.
M5: _normalize_for_hash and generate_source_hash's docstrings still listed only columns/tags/tableConstraints/owners as sorted, but aliases was added to the sort list when the mssql synonym feature landed. Update both to mention it.
The Playwright fixture mockEntitySearchConfig deep-equals the table config returned by PUT /system/settings/reset/searchSettings. Adding the aliases search fields and highlight field to searchSettings.json made that assertion fail in all three SearchSettings specs that call restoreDefaultSearchSettings. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The v202 search-settings migration can throw on null/odd assetType entries (schema allows missing assetType) and a new UI unit test assertion is overly broad/misleading due to WidgetCard rendering buttons.
Review details
Suppressed comments (2)
Previously missed (1) — in code that hasn't changed since the last review.
openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableAliases/TableAliases.test.tsx:107
- This test asserts that there are no elements at all, but the real WidgetCard renders an expand/collapse button. The test currently passes only because WidgetCard is mocked. Narrow the assertion to the widget content (the aliases table) so it verifies “no edit controls” without depending on WidgetCard internals.
openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v202/TableAliasesSearchSettingsMigration.java:81
- findTableConfiguration compares assetType using String.equals without guarding against null. SearchSettings schema does not require assetType, so a null entry would throw a NullPointerException and skip the migration. Using equalsIgnoreCase on the constant avoids NPEs and also tolerates operator-provided case differences.
private static AssetTypeConfiguration findTableConfiguration(SearchSettings settings) {
AssetTypeConfiguration match = null;
if (settings != null) {
for (AssetTypeConfiguration config : listOrEmpty(settings.getAssetTypeConfigurations())) {
if (TABLE_ASSET_TYPE.equals(config.getAssetType())) {
match = config;
break;
}
- Files reviewed: 46/69 changed files
- Comments generated: 0 new
- Review effort level: Lite
There was a problem hiding this comment.
🟡 Changes recommended
There are at least two concrete UI issues likely to break lint/type-checking (useEffect deps and missing React/ReactNode import in the new Jest test).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableAliases/TableAliases.test.tsx:31
- This test references
React.ReactNodebut doesn’t importReact(orReactNode). In this codebase tests typically import React when using theReact.*namespace; without it, TS type-checking / linting can fail.
- Files reviewed: 46/69 changed files
- Comments generated: 1
- Review effort level: Lite
| useEffect(() => { | ||
| if (isEmpty(aliasRows)) { | ||
| filterWidgets?.([DetailPageWidgetKeys.TABLE_ALIASES]); | ||
| } | ||
| }, [aliasRows]); |
There was a problem hiding this comment.
🔵 Needs a closer look
It is a broad cross-layer change (schema + ingestion + lineage + search + migration + UI) that warrants a final maintainer review despite strong automated test coverage.
Review details
- Files reviewed: 46/69 changed files
- Comments generated: 0 new
- Review effort level: Lite
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🔵 Needs a closer look
It’s a large cross-layer change (spec/schema, ingestion, backend persistence+migrations, search, lineage, UI) that warrants final human maintainer review of upgrade/migration semantics and system-wide compatibility.
Review details
- Files reviewed: 46/69 changed files
- Comments generated: 0 new
- Review effort level: Lite
Resolve three conflicts from main's new v202 migration:
- migration/{mysql,postgres}/v202/Migration.java (add/add): main added
repairNameKeywordSearchFields + repairAllowedFields at the same version this
branch used for the table-aliases backfill. All three are idempotent, so run
all three rather than picking a side.
- utils/TableTabsUtils.tsx: keep both the TableAliases lazy widget and main's
new isDbtTabHidden / getSampleDataTabChildren / getTableQueriesTabChildren
helpers; they don't overlap.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🔵 Needs a closer look
There are a few concrete correctness/CI-blocking issues in the newly added UI and migration logic (e.g., missing React import in the new test and a hooks dependency omission) that should be fixed before approval.
Review details
Suppressed comments (3)
openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableAliases/TableAliases.component.tsx:88
- The effect uses
filterWidgetsbut it is not included in the dependency array, which will violate the exhaustive-deps rule and can also capture a stalefilterWidgetsreference if the context changes.
openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableAliases/TableAliases.test.tsx:14 - This test file references
React.ReactNodein the WidgetCard mock props type, but React is not imported, which can cause a TypeScript compile error (Cannot find namespace 'React').
openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v202/TableAliasesSearchSettingsMigration.java:81 findTableConfigurationmatches the table asset type with a case-sensitive equals. Other search-settings repairs useequalsIgnoreCase, and operator-modified settings could reasonably differ in case; usingequalsIgnoreCasemakes the migration more robust and avoids silently skipping the merge.
private static AssetTypeConfiguration findTableConfiguration(SearchSettings settings) {
AssetTypeConfiguration match = null;
if (settings != null) {
for (AssetTypeConfiguration config : listOrEmpty(settings.getAssetTypeConfigurations())) {
if (TABLE_ASSET_TYPE.equals(config.getAssetType())) {
match = config;
break;
}
- Files reviewed: 46/65 changed files
- Comments generated: 0 new
- Review effort level: Lite
Adding the TABLE_ALIASES case pushed the getWidgetHeight switch to a cyclomatic complexity of 11, over the sonarjs limit of 10. Replace the switch with a lookup against an explicit list of the keys it handled, so widgets absent from that list still fall back to height 1 (notably CUSTOM_PROPERTIES and KNOWLEDGE_ARTICLE, which have entries in defaultWidgetHeight but were never cased). Add TableClassBase.test.ts to pin that behaviour; it passes against both the old switch and the lookup. This also clears the Licence Header check, which only failed because `yarn lint:base --fix` aborted on the ESLint error before the lint step could revert organize-imports' writes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Code Review 👍 Approved with suggestions 3 resolved / 4 findingsIngests SQL Server synonyms as embedded aliases on canonical tables, enabling lineage resolution through synonym references and cross-database table discovery. The implementation uses an opt-in Consider improving the Aliases widget to disambiguate entries with identical trailing names (e.g., 💡 Edge Case: Aliases with same trailing name render as indistinguishable rows📄 openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableAliases/TableAliases.component.tsx:41-49 📄 openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableAliases/TableAliases.component.tsx:59-67 📄 openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableAliases/TableAliases.component.tsx:76-78 getAliasName reduces each alias FQN to its trailing name only, so two synonyms differing solely in service/database/schema (e.g. ✅ 3 resolved✅ Performance: Alias fallback adds an ES query to every failed lineage lookup
✅ Quality: includeSynonyms defaults to true, silently enabling sweep on upgrade
✅ Bug: Alias backfill moved to v1135 will be skipped on 2.x upgrades
🤖 Prompt for agentsOptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
|
🚦 Removed from the merge queue —
|



Describe your changes:
Fixes #31512
I worked on ingesting SQL Server synonyms because the MSSQL connector discovers tables and views through
INFORMATION_SCHEMA.TABLES, so synonyms — a separate object type — were invisible, and any query or view definition referencing a synonym produced no lineage.A deliberate design divergence worth flagging up front: the issue text asks for synonyms "represented as entities." This PR instead implements the embedded-aliases model — a synonym is recorded as an alternate fully-qualified name on the canonical
Table, not as a second entity. That follows the recommendation in the design note, which compares three models and rejects the standalone-entity option: it would create two pages and two search identities for one governed asset, force every generic feature to either support or exclude the alias, make owners/tags/domains/policies ambiguous, inflate asset counts, and need special lineage rules to avoidtarget -> alias -> consumeredges. If reviewers want the entity model instead, that is a scope decision to settle before this merges.Screen.Recording.2026-08-20.at.6.26.04.PM.mov
Type of change:
High-level design:
A synonym's alternate FQN is stored in a new source-managed
Table.aliases[]array. One governed asset, one page, one search identity.The ordering problem and how it's solved. The alias has to be written onto the target table's create request, but the target usually lives in a different database than the synonym, and
get_database_names()walks databases one at a time re-pointing the inspector — so whenanalytics_coreis being ingested we cannot reach intoanalytics_master. The connector therefore sweepssys.synonymsacross every in-scope database up front inprepare()(which runs before the topology produces anything), builds a boundedtarget FQN -> [alias FQNs]map, and resolves targets by construction: a newget_table_aliases()hook looks the current table's own FQN up in that map.Consequences of that choice:
skip_es_search=Trueis load-bearing — on an index missfqn.buildreturns a literal FQN string that no later exact lookup matches.PUTreplacing the array, which is verified by integration test rather than assumed.Key components:
mssql/synonyms.py(new) — bracket-aware T-SQL identifier tokenizer,base_object_namenormalization, and the boundedSynonymMap.common_db_source.py— a genericget_table_aliases()hook (returnsNoneby default) beside the existingget_source_url/get_location_pathhooks. No SQL Server knowledge enters this shared file.TableMapper+TableRepository— the two server-side wirings that make the field actually persist.recordListChange(notrecordChange) followsGlossaryTerm.synonyms, the closest analogue: plainrecordChangecompares lists withObject::equals, which is order-sensitive and does not normalizenullagainst[], so it would bump the version and emit a change event on every run for an unchanged alias set.sql_lineage.py+es_mixin.py— an exact-alias fallback in the generic resolver. This is deliberate:MssqlLineageSourceis a separate source class in a separate workflow, so a lineage run never executesMssqlSource.prepare()and cannot see that map. Putting the fallback insearch_table_entitiescovers both workflows and any future connector that populatesaliases. Matching is keyword-exact only — a fuzzy hit would silently attach an edge to the wrong table.searchSettings.json+v210/MigrationUtil—aliasesadded to the tablesearchFieldsandhighlightFields, with a migration so upgraded instances get it too, not just fresh installs.Backward compatibility. Tables with no aliases are unaffected: the hook returns
Nonefor every non-MSSQL connector, andrecordListChangeshort-circuits when both sides are empty, so there is no version bump, change event, or feed entry. One expected one-time effect:aliasesnow participates insourceHash, so the first ingestion run after upgrade recomputes a different digest for every table in every SQL connector and skips none. That is inherent to adding anyCreateTableRequestfield.Known limitation.
sys.synonyms.base_object_namepreserves the casing typed inCREATE SYNONYMwith no normalization to the target's stored casing, so under SQL Server's default case-insensitive collation the map lookup is case-folded. The inverse trade is that under a case-sensitive (CS_AS) collation two targets differing only in case would merge — strictly rarer than the bug it fixes.Tests:
Use cases covered
analytics_core.dbo.orders->analytics_master.dbo.orders) attaches as an alias on the canonical table inanalytics_master.RemoteTargetUnmapped.Unit tests
tests/unit/topology/database/test_mssql_synonyms.py(45 tests — tokenizer,base_object_nameparsing, bounded map, case-folding, sweep, source wiring, unresolved reporting),test_common_db_source_aliases.py,test_source_hash.py,test_table_aliases_schema.py,tests/unit/lineage/test_alias_resolution.py.TableIndexTest.java,migration/utils/v210/MigrationUtilTest.java.TableAliases.test.tsx(3 tests).mvn -pl openmetadata-service test -Dtest='TableIndexTest,MigrationUtilTest'148 passed, 0 failures;yarn test --testPathPattern TableAliases3 passed.spotless:checkandmake py_format_checkclean.jacoco:report/--covwere not run. Stating that rather than guessing a number.Backend integration tests
openmetadata-integration-tests/for new/changed API endpoints.TableResourceIT#put_tableAliases_replaceNotMerge— covers initial set, retarget, and clear, asserting on the entity re-fetched from the server rather than the mutation response. This test is why the "reconciliation is free" claim above is a verified property and not an assumption; the first version of it passed while persistence was actually broken, because it only proved the response echoed the request.Ingestion integration tests
sys.synonyms, cross-database resolution works, and an unresolvable synonym lands in the unresolved report. Realbase_object_nameformat observed: fully bracket-quoted three-part, case preserved as typed.Playwright (UI) tests
openmetadata-ui/.../ui/playwright/.playwright/e2e/Pages/TableAliases.spec.ts— executed and passing against a live stack built from this branch (5 passed, 42.4s).Manual testing performed
analytics_masterwithdbo.orders, andanalytics_corewithCREATE SYNONYM dbo.orders FOR analytics_master.dbo.ordersplusCREATE SYNONYM dbo.missing_orders FOR analytics_master.dbo.does_not_exist....analytics_core.dbo.ordersagainst target...analytics_master.dbo.orders.missing_ordersappeared inunresolved()rather than being dropped.base_object_namevalues returned bysys.synonymsto validate the parser against actual server output rather than assumed formatting.Since opening this PR, the whole flow has been verified end to end against a live stack built from this branch (server revision
2418c14062, Elasticsearch 9.3.0) plus a real SQL Server 2022 CU26 container. Every claim above is now backed by execution rather than tracing:analytics_master.dbo.orders->aliases: [...analytics_core.dbo.orders]FOR ...dbo.customersvs actual tableCustomers)Unresolved/RemoteTargetUnmappedin pipeline status; run stayed 100% / 0 errorshighlightreturns the matched alias; the synonym never appears as its own entityaliases.keywordlookup (the resolver's ES call)analytics_coreselectingFROM dbo.orders_v2(a synonym) produced the edgeanalytics_master.dbo.orders -> analytics_core.dbo.orders_summary— resolved across databases, with the synonym never appearing as a lineage nodeanalytics_core.dbocontains only the view; no synonym leaked in as an entitysourceHashstability0.1— no spurious bump0.1 -> 0.2, search returns 0 hits for the dropped alias and 1 for the new oneOne caveat found while testing, not shipped-breaking:
MssqlSource.close()is not idempotent — calling it twice duplicates the unresolved-synonym warnings. The normal workflow path calls it once (runs correctly report 2 warnings, not 4), so this is a latent robustness nit rather than a live defect.A correction to my own earlier wording: the exact-keyword check above proves the resolver's lookup, not that an edge gets created. Those are different claims, so I tested the second one separately by adding a view that selects from a synonym and running the lineage workflow — the edge lands on the canonical table, which is the row now in the table above.
One note on the spec's "searching an alias returns one result" wording: an exact keyword lookup does return exactly one. An analyzed free-text search returns the canonical table ranked first, but sibling tables whose alias FQNs share tokens can also match — ordinary analyzed-search behaviour. The property that matters holds: one governed asset is never duplicated, and the synonym is never its own result.
UI screen recording / screenshots:
TODO — opening as draft. The UI change is a read-only Aliases widget on the table detail page; a recording needs a stack with ingested alias data, which I could not stand up here.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.