OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

[StarRocks] Table comments not ingested / not shown

Open TKilome opened this issue 8 months ago • 9 comments

Describe the bug

When using the StarRocks connector, table comments (and possibly column comments) are not retrieved or not displayed in OpenMetadata after ingestion.

Expected behavior

Table-level COMMENT defined in StarRocks (e.g. in CREATE TABLE ... COMMENT '...') should appear as the dataset/table description in OpenMetadata, consistent with behavior on other SQL sources.

Actual behavior

Table comments are missing or empty in the UI/metadata after a successful ingestion run.

How to reproduce

  1. In StarRocks, create a table with a table comment, e.g.:
Image Image

TKilome avatar Mar 23 '26 09:03 TKilome

Additional investigation

While checking the metadata ingestion agent logs, I noticed warnings similar to the following :

Image

Based on this, I suspect the third-party metadata / reflection layer used to read StarRocks table metadata did not successfully parse the table-level COMMENT from the DDL or reflection output (e.g. differences between StarRocks and MySQL in SHOW CREATE TABLE / information_schema behavior), even though comments may be visible when querying information_schema directly.

Request: Please confirm how the StarRocks connector obtains table/column comments (DDL parsing vs information_schema), and whether StarRocks-specific formatting is supported.

Attachments: I can provide full agent logs (redacted) if needed.

TKilome avatar Mar 23 '26 09:03 TKilome

Additional root-cause analysis (SQLAlchemy reflection)

We investigated how SQLAlchemy (MySQL dialect) resolves table-level COMMENT.

Behavior: Table options (including COMMENT) are parsed from the line that follows the closing ) of the column list — but the parser in MySQLTableDefinitionParser effectively ties table-level options to the same line as ) (see _parse_table_options processing lines starting with ) in sqlalchemy/dialects/mysql/reflection.py).
If COMMENT is placed on the next line (not on the same line as ) together with ENGINE=...), the table COMMENT is not captured, and the parser may emit warnings for unrecognized trailing DDL lines.

MySQL: The common pattern puts the whole tail on one line after ), e.g.
) ENGINE=InnoDB ... COMMENT='...'
→ SQLAlchemy can parse mysql_comment from that line.

StarRocks: SHOW CREATE TABLE often formats DDL with COMMENT on a separate line after ) / ENGINE=OLAP / keys / etc., for example:

) ENGINE=OLAP DUPLICATE KEY(...) COMMENT "审计日志表" PARTITION BY ...

TKilome avatar Mar 23 '26 12:03 TKilome

I've had the same problem and hope to fix it soon.

Image

roger1419 avatar Mar 26 '26 02:03 roger1419

Hi, I'd like to work on this! I've understood the fix, overriding get_table_description() to query INFORMATION_SCHEMA.TABLES directly instead of relying on SQLAlchemy's MySQL DDL parser which drops the COMMENT when it's on a separate line in StarRocks DDL. PR is almost ready, submitting shortly.

yash-agarwa-l avatar Apr 04 '26 08:04 yash-agarwa-l

Hi @TKilome @harshach ! I'd like to work on this issue. Could you please assign it to me? Thanks.

david-mamani avatar Apr 09 '26 02:04 david-mamani

Hi @TKilome i would love to work on this issue. please assign it to me

Thanks.

unnatikdm avatar Apr 13 '26 06:04 unnatikdm

Hi, please assign this to me

Uche44 avatar Apr 15 '26 19:04 Uche44

Hi @TKilome , I'd like to work on this. My approach: find the StarRocks connector in the ingestion framework, locate where table metadata is fetched (likely via information_schema.tables), and map the TABLE_COMMENT field to the table description — mirroring how the MySQL connector handles it. Will also check column comments. Can you assign this to me?

DivyDeshmukh avatar Apr 15 '26 21:04 DivyDeshmukh

Thank you everyone for you interest on this. We have assigned this issue and will not be accepting no PR's for this issue at this time, but will reopen if that changes

PubChimps avatar Apr 16 '26 01:04 PubChimps