Skip to content

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

Description

@harshsoni2024

Connector

Trino

Feature area

Metadata ingestion

Describe the bug

Two defects that together cause Trino column descriptions to silently stop syncing.

1. Columns with no comment are ingested with an empty-string description

Trino's SHOW COLUMNS reports a column with no comment as the empty string, never NULL. _get_columns in ingestion/src/metadata/ingestion/source/database/trino/metadata.py passes record.Comment straight through to description, so every uncommented column lands in OpenMetadata with "description": "" rather than no description at all. An explicit COMMENT '' produces the same value, so the two cases are indistinguishable at that layer.

2. Updated column comments are not ingested even with overrideMetadata: true

Once a column has a non-empty description, a re-run never updates it. The entity-level updateDescription() in EntityRepository.java honours the overrideMetadata flag, but the column-level updateColumnDescription() does not — it unconditionally reverts a bot PUT whenever the stored column description is non-empty. updateColumnDisplayName() has the same gap.

The two defects mask each other. A column with no comment is stored as "", which is nullOrEmpty, so its first comment does land — making the sync look functional right up until a second update to an already-described column is silently dropped.

To Reproduce

Part 1 — blank descriptions

  1. In Trino, create a table mixing all three comment states:
    CREATE TABLE memory.testdb.student_data (
        id BIGINT,
        age INTEGER COMMENT '',
        name VARCHAR COMMENT 'Name of the student'
    );
  2. Run metadata ingestion for the Trino service.
  3. Fetch the table's columns from the API. id and age both come back as "description": "" instead of having no description.

Part 2 — updates dropped

  1. Create a table where one column has a comment and another does not:
    CREATE TABLE memory.default.fruits (
        type VARCHAR,
        price DOUBLE COMMENT 'price of fruit'
    );
  2. Run ingestion. type is stored as "", price as price of fruit.
  3. Change both comments in Trino:
    COMMENT ON COLUMN memory.default.fruits.type IS 'first comment on fruit type';
    COMMENT ON COLUMN memory.default.fruits.price IS 'second comment on fruit type';
  4. Re-run ingestion with overrideMetadata: true.
  5. type updates correctly, but price keeps the stale price of fruit.

As a control, ingesting the same Trino source into a brand-new service produces the correct description for both columns — that path is an insert, so no merge guard runs. This confirms the connector reads the updated comments correctly and the loss is in the server-side column merge, not in extraction.

Expected behavior

  1. A column with no comment in Trino should be ingested with no description, not an empty string, so it is not shown as described and does not interfere with later updates.
  2. With overrideMetadata: true, a changed source comment should overwrite the stored column description, matching the behaviour already provided for the entity-level description.

Connection / ingestion config

source:
  type: trino
  serviceName: <redacted>
  serviceConnection:
    config:
      type: Trino
      hostPort: <redacted>
      username: <redacted>
      authType:
      catalog: memory
  sourceConfig:
    config:
      type: DatabaseMetadata
      overrideMetadata: true
sink:
  type: metadata-rest
  config: {}
workflowConfig:
  loggerLevel: DEBUG
  openMetadataServerConfig:
    hostPort: <redacted>/api
    authProvider: openmetadata
    securityConfig:
      jwtToken: <redacted>

OS

macOS 26.5.1

Python version

3.11.15

OpenMetadata version

2.0.0-SNAPSHOT (main)

Additional context

Root causes located at:

  • ingestion/src/metadata/ingestion/source/database/trino/metadata.py — _get_columns passes the empty-string comment through unchanged. TRINO_TABLE_COMMENTS filters is not null but not COMMENT '', so the table comment has the same gap.
  • openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java — ColumnEntityUpdater.updateColumnDescription / updateColumnDisplayName omit the !overrideMetadata condition that updateDescription() and updateDisplayName() both have.

Note that fixing only the ingestion side is not sufficient: it stops new blank descriptions but leaves existing non-empty column descriptions permanently un-updatable by ingestion. Both sides are needed.

I have a fix ready and will open a PR linking this issue.

Pre-submission checklist

  • I searched for duplicate issues.
  • I removed credentials, hostnames, emails, and other sensitive data from logs and config.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ingestionbugconnector:other

    Type

    No type

    Projects

    • Status
      Done ✅
    • Status
      Done ✅

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions