Skip to content

fix(backend): column description updation with overrideMetadata=true - #31543

Merged
harshsoni2024 merged 5 commits into
mainfrom
trino_column_description_update_issue
Aug 18, 2026
Merged

harshsoni2024 merged 5 commits into
mainfrom
trino_column_description_update_issue

Conversation

@harshsoni2024

@harshsoni2024 harshsoni2024 commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #31544

I worked on the backend half of #31544: once a table column had a non-empty
description, ingestion could never update it again, even with
overrideMetadata: true.

The entity-level updateDescription() in EntityRepository consults the
overrideMetadata flag that the bulk path sets from
PUT /v1/tables/bulk?overrideMetadata=true. The column-level
updateColumnDescription() did not — it unconditionally reverted a bot PUT
whenever the stored column description was non-empty, so a changed source
comment could never reach an existing column. updateColumnDescription() now
consults the flag, matching the entity-level behaviour.

The guard keeps one condition that the entity-level version does not:
overrideMetadata may replace a column description but never blank it.

&& (!overrideMetadata || nullOrEmpty(updatedColumn.getDescription()))

A connector that finds no comment on a column omits the field from the payload
entirely, so the incoming description arrives as null. Without that clause, an
override run would read the absence as a deletion and wipe hand-written column
documentation on every uncommented column. Clearing a column description
therefore still requires a PATCH (UI edit or API) — ingestion is replace-only.

overrideMetadata deliberately does not extend to the column displayName.
Connectors rarely send one, so honouring the flag there would blank curated
column display names on nearly every override run. updateColumnDisplayName() is
left as-is and covered by a test that pins that asymmetry.

The overrideMetadata field moves from private to protected because
ColumnEntityUpdater is a subclass of EntityUpdater and a private superclass
field does not resolve by simple name.

Companion PR: the connector-side half of #31544 (Trino reporting an unset
column comment as '', so uncommented columns were ingested with
description: "") is on branch trino_empty_column_comment_fix and ships
separately. Both are needed to close the issue: this PR lets an updated comment
reach an already-described column, and the connector PR stops blank descriptions
being written in the first place.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • Re-running ingestion with overrideMetadata: true propagates an updated source
    comment onto a column that already has a non-empty description
  • Re-running ingestion without overrideMetadata still preserves a
    user-curated column description (no regression to the existing protection)
  • An overrideMetadata run that supplies no description for a column does not
    blank the stored one
  • A curated column displayName survives an overrideMetadata run

Unit tests

  • Not applicable — the change is a merge-path condition on the bulk PUT
    endpoint, exercised end-to-end by the integration tests below rather than by a
    unit test. EntityUpdater is an inner class reached through the repository, so
    a unit test here would assert mock wiring rather than behaviour.

Backend integration tests

  • I added integration tests in openmetadata-integration-tests/.
  • File updated:
    openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/BulkOverrideMetadataIT.java
    — four column-level cases alongside the existing table-level ones:
    • test_botCannotOverwriteColumnDescription_withoutOverride
    • test_botOverwritesColumnDescription_withOverride
    • test_overrideDoesNotBlankColumnDescription
    • test_columnDisplayNamePreserved_evenWithOverride

Ingestion integration tests

  • Not applicable (no ingestion changes on this branch).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

Local Trino (memory catalog) against a locally built OpenMetadata stack, with
overrideMetadata: true in the ingestion config. The companion connector fix was
also applied locally, since reproducing the original report end to end needs
both.

  1. Table memory.default.fruits with a price column carrying the comment
    'price of fruit'. Ran ingestion; OpenMetadata showed
    price → 'price of fruit'.
  2. Changed the comment in Trino:
    COMMENT ON COLUMN memory.default.fruits.price IS 'second comment on fruit type';
  3. Re-ran ingestion with overrideMetadata: true against the existing
    service. Before this change, price kept the stale 'price of fruit'.
  4. As a control, ingested the same source into a brand-new service. All comments
    were correct there — that path is an insert, so no merge guard runs. This
    confirmed the loss was in the server-side column merge, not in extraction.
  5. Rebuilt the backend with this change, redeployed, re-ran on the existing
    service: price now updates to 'second comment on fruit type'.

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #31544 above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: not applicable, no schema changes.
  • For UI changes: not applicable.
  • I have added tests (integration) and listed them above.
  • I have added a test that covers the exact scenario we are fixing.

Greptile Summary

This PR allows bot-driven bulk ingestion with overrideMetadata=true to replace existing column descriptions while preserving them when the incoming description is absent or empty.

  • Exposes the updater’s override flag to column-level update logic.
  • Adds integration coverage for override, non-override, absent-description, and display-name behavior.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete blocking or non-blocking defects identified.

The override flag is set on a fresh updater for each bulk entity, remains disabled on ordinary PUTs, and the revised guard preserves existing descriptions for absent or empty incoming values while permitting explicit non-empty replacements.

Important Files Changed

Filename Overview
openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java Correctly scopes column-description replacement to bot bulk updates with override enabled while retaining the no-blank safeguard.
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/BulkOverrideMetadataIT.java Adds synchronous persisted-state integration coverage for all intended column-level override behaviors.

Reviews (1): Last reviewed commit: "test(it): pin that overrideMetadata does..." | Re-trigger Greptile

…a on columns

Trino's SHOW COLUMNS reports an unset column comment as the empty string rather
than NULL, and reports an explicit COMMENT '' the same way. _get_columns passed
that through unchanged, so uncommented columns were ingested with
description: "" instead of no description. Normalize '' to None so the sink's
exclude_none drops the field, and apply the same normalization to the table
comment.

Separately, ColumnEntityUpdater.updateColumnDescription and
updateColumnDisplayName ignored the overrideMetadata flag that the entity-level
updateDescription already honors, so a bot PUT always reverted a non-empty
column description and a changed source comment could never reach an existing
column. Both now check !overrideMetadata; the field moves from private to
protected so the ColumnEntityUpdater subclass can read it.

The two defects masked each other: a column stored as "" is nullOrEmpty, so its
first comment landed and the sync appeared to work until a second update to an
already-described column was dropped.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@harshsoni2024
harshsoni2024 requested review from a team as code owners August 14, 2026 12:41
Copilot AI lite review requested due to automatic review settings August 14, 2026 12:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@github-actions

github-actions Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 9fd5369d2494280908099c5d69dc6c2670de0ee4 in Playwright run 32019646400, attempt 1.

✅ 551 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 50m 33s

⏱️ Max setup 3m 12s · max shard execution 19m 10s · max shard-job elapsed before upload 22m 22s · reporting 5s

🌐 214.06 requests/attempt · 2.83 app boots/UI scenario · 10.78% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 214.06 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.83 per UI scenario (1619 boots / 572 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 141 0 0 0 0 0
✅ Shard chromium-02 128 0 0 0 0 0
✅ Shard chromium-03 130 0 0 0 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 14 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@pmbrull pmbrull added this to Shipping Aug 14, 2026
harshsoni2024 and others added 3 commits August 17, 2026 15:38
overrideMetadata now lets ingestion replace a non-empty column description but
never clear it. A connector that finds no comment on the column omits the field
entirely, so an override run would otherwise read that absence as a deletion and
wipe curated text.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The connector-side normalization of Trino's empty column comments is unrelated to
the backend column-merge fix and reviews independently, so it now lives on
trino_empty_column_comment_fix. This branch keeps only the EntityRepository
change and its integration tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
updateColumnDisplayName intentionally has no overrideMetadata term: connectors
rarely send a column displayName, so honouring the flag there would blank curated
values on nearly every override run. The test asserted the opposite and would
have failed CI. Assert instead that the curated displayName survives, so the
asymmetry with the description path is pinned rather than accidental.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 17, 2026 10:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@harshsoni2024 harshsoni2024 changed the title fix(trino): don't ingest blank Trino column comments, and honor overrideMetadata for column descriptions fix(backend): column description updation with overrideMetadata=true Aug 17, 2026
@harshsoni2024
harshsoni2024 added this pull request to the merge queue Aug 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-08-17T17:33:23Z)

Blocked the queue: playwright-summary, py-checkstyle

@harshsoni2024
harshsoni2024 added this pull request to the merge queue Aug 18, 2026
Merged via the queue into main with commit f424fb3 Aug 18, 2026
117 of 121 checks passed
@harshsoni2024
harshsoni2024 deleted the trino_column_description_update_issue branch August 18, 2026 10:59
@github-project-automation github-project-automation Bot moved this from In Review / QA 👀 to Done ✅ in Shipping Aug 18, 2026
@gitar-bot

gitar-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Updates column-level description merging during bulk ingestion to respect the overrideMetadata flag while preventing empty values from blanking existing descriptions. No issues found.

Options

Display: compact → Showing less information.

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

harshsoni2024 added a commit that referenced this pull request Aug 18, 2026
…31543)

* fix(trino): normalize empty column comments and honor overrideMetadata on columns

Trino's SHOW COLUMNS reports an unset column comment as the empty string rather
than NULL, and reports an explicit COMMENT '' the same way. _get_columns passed
that through unchanged, so uncommented columns were ingested with
description: "" instead of no description. Normalize '' to None so the sink's
exclude_none drops the field, and apply the same normalization to the table
comment.

Separately, ColumnEntityUpdater.updateColumnDescription and
updateColumnDisplayName ignored the overrideMetadata flag that the entity-level
updateDescription already honors, so a bot PUT always reverted a non-empty
column description and a changed source comment could never reach an existing
column. Both now check !overrideMetadata; the field moves from private to
protected so the ColumnEntityUpdater subclass can read it.

The two defects masked each other: a column stored as "" is nullOrEmpty, so its
first comment landed and the sync appeared to work until a second update to an
already-described column was dropped.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(service): don't blank a column description on overrideMetadata runs

overrideMetadata now lets ingestion replace a non-empty column description but
never clear it. A connector that finds no comment on the column omits the field
entirely, so an override run would otherwise read that absence as a deletion and
wipe curated text.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* revert(trino): move the empty column comment fix to its own branch

The connector-side normalization of Trino's empty column comments is unrelated to
the backend column-merge fix and reviews independently, so it now lives on
trino_empty_column_comment_fix. This branch keeps only the EntityRepository
change and its integration tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* test(it): pin that overrideMetadata does not touch a column displayName

updateColumnDisplayName intentionally has no overrideMetadata term: connectors
rarely send a column displayName, so honouring the flag there would blank curated
values on nearly every override run. The test asserted the opposite and would
have failed CI. Assert instead that the curated displayName survives, so the
asymmetry with the description path is pinned rather than accidental.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: IceS2 <pablo.takara@getcollate.io>

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs

Projects

Status: Done ✅

Development

Successfully merging this pull request may close these issues.

Trino: empty column comments ingested as "", and updated column comments ignored with overrideMetadata=true

3 participants