Skip to content

Backport (2.0): Fixes #34689: keep a table's tags and data products off its column search entries - #39340

Merged
anuj-kumary merged 4 commits into
2.0from
anuj-kumary/backport-column-entries-own-tags-2.0
Dec 1, 2026
Merged

anuj-kumary merged 4 commits into
2.0from
anuj-kumary/backport-column-entries-own-tags-2.0

Conversation

@anuj-kumary

Copy link
Copy Markdown
Member

Describe your changes:

Backport to 2.0 of the search part of #35026 ("keep a table's tags and data products off its column entries"). Fixes #34689 on the 2.0 line.

Problem (customer-reported, Payoneer on 2.0.10): a classification's Assets tab counts columns that were never tagged. 559 tagged tables/views showed 1,312 assets because 753 columns were counted too. On 2.0, a table's tags and dataProducts changes are copied by update-by-query onto every child index, column_search_index included. That copy races with ColumnSearchIndex, which builds a column's entry from the column's own tags only. So the table's tags leak onto some column entries, and those columns match the tag in search.

Fix:

  • PropagationDescriptor gains skippedChildAliases + skipping(...) / reaches(alias). The 3-arg constructor is kept, so existing callers (and Collate) compile unchanged.
  • TableRepository marks tags and dataProducts as .skipping(TABLE_COLUMN).
  • SearchRepository.propagateInheritedFieldsToChildren groups the non-time-series child aliases by the fields they skip and sends each group its own updateChildren request. Test cases still get the table's tags; columns still get owners/domains/etc.
  • Adds a 2.0 copy of ADR:2026-10-08-column-entries-carry-only-their-own-tags, scoped to 2.0.

Not backported: the bulk-edit / Assets-tab PATCH rewrite from #35026, and glossary-term inheritance on column entries (inheritedTermsOnlyFor). 2.0 has no field-level term inheritance, so on 2.0 column entries carry only their own tags, the same as ColumnSearchIndex already builds them.

Existing data: column entries that already carry leaked tags keep them until they are rebuilt. Reindexing tableColumn clears them.

Tests

  • New SearchRepositoryBehaviorTest.propagateInheritedFieldsToChildrenKeepsTableTagsAndDataProductsOffColumnEntries. It uses the real TableRepository descriptors and asserts that testCase gets tagAdded + updatedDataProducts + updatedOwners while tableColumn gets only updatedOwners. It fails without the TableRepository change (1 updateChildren call instead of 2) and passes with it.
  • SearchRepositoryBehaviorTest: 130/130 pass locally. mvn spotless:check is clean.

Type of change:

  • Bug fix

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.

🤖 Generated with Claude Code

…ff its column search entries

A table's tag and data-product changes were copied by update-by-query onto every
child index, column_search_index included, racing ColumnSearchIndex. Columns then
showed up on a classification's or data product's Assets tab they do not carry.

Backports the search part of #35026: PropagationDescriptor.skipping() lets a
descriptor skip child indexes, and TableRepository keeps tags and dataProducts
off tableColumn. Child aliases are grouped by skipped fields so each group gets
its own updateChildren request.
@anuj-kumary
anuj-kumary requested a review from a team as a code owner December 1, 2026 04:45
@anuj-kumary
anuj-kumary requested review from sonika-shah and removed request for a team December 1, 2026 04:45
@github-actions

github-actions Bot commented Dec 1, 2026

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.

Column entries no longer take the table's tags by cascade, but a column without
its own tier inherits the table's, which lives in tags. Rebuild the entries
through ColumnSearchIndex on a tags change so the tier stays current.
Column entries take only the tier from the table's tags, so an ordinary tag
change keeps the inherited-field update instead of a delete-and-rebuild of
every column entry.
@sonika-shah sonika-shah added the safe to test Add this label to run secure Github workflows on PRs label Dec 1, 2026
@gitar-bot

gitar-bot Bot commented Dec 1, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk 2 closed / 2 findings

Changing table-field propagation and tier-triggered column reindexing alters search-index contents; routing errors could omit inherited fields or leave stale tags.

Stops a table's tags and data products from being copied onto its column search entries during propagation, so column entries carry only their own tags and classification counts no longer include untagged columns. Table tier changes no longer reach column entries, and table tag changes now fully re-index every column entry. No open issues found.

✅ 2 closed
✅ Bug: Table tier changes no longer reach column entries

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TableRepository.java:1980-1983 📄 openmetadata-service/src/main/java/org/openmetadata/service/search/SearchRepository.java:2543-2557 📄 docs/decisions/2026-10-08-column-entries-carry-only-their-own-tags.md:20-21
In OpenMetadata a table's tier is stored as a Tier.* label inside tags. Before this PR, the tags propagation (generateAdd/UpdateTagLabelListScript + SearchClient.TAG_RESEPARATION_SCRIPT) was the only live path that moved a table's new tier into a column entry: the script added the label, then the reseparation lifted it into ctx._source.tier. This PR adds .skipping(Entity.TABLE_COLUMN) to the whole tags descriptor, so column entries now get no tags update at all.

Nothing else on a normal table update replaces it. syncTableColumns → updateTableColumnsInheritedFields rewrites table ref, owners, domains, followers and votes, but not tier. indexTableColumns only runs when a columns.* field changed. So if you set or change a table's tier, its column entries keep the old tier until you reindex tableColumn. Tier filters on columns return wrong results. This contradicts the ADR added here, which says column entries carry the table's tier.

Fix: when the table's tags change, rebuild the column entries through ColumnSearchIndex (which already derives the inherited tier correctly). Alternatively, set tier in updateTableColumnsInheritedFields for columns without their own tier. Then add a test where only the table's tier changes.

✅ Performance: Any table tag change fully re-indexes every column entry

📄 openmetadata-service/src/main/java/org/openmetadata/service/search/SearchRepository.java:1342-1343 📄 openmetadata-service/src/main/java/org/openmetadata/service/search/SearchRepository.java:1368-1376
hasTagsChanged matches any change to the table's tags field. That means adding or removing an ordinary classification or glossary tag, which this PR now keeps off column entries, still sends the table down the deleteTableColumns + indexTableColumns path. That path is a delete-by-query on table.id followed by a bulk rebuild of every flattened column. Only a change to the Tier.* label affects column docs (ColumnSearchIndex reads only the table's tier). So bulk-tagging many wide tables (the Assets-tab case behind this fix) does a full column reindex per table, and those tables' column entries briefly drop out of search for no reason.

Fix: rebuild only when the tier label differs between the FieldChange old and new values. Otherwise fall back to updateTableColumnsInheritedFields.

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

@anuj-kumary
anuj-kumary merged commit bea9b57 into 2.0 Dec 1, 2026
73 of 75 checks passed
@anuj-kumary
anuj-kumary deleted the anuj-kumary/backport-column-entries-own-tags-2.0 branch December 1, 2026 08:42
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.

3 participants