Respect Trino case insensitivy in Lineage ingestion
Affected module Does it impact the UI, backend or Ingestion Framework?
Ingestions Framework, Trino Connector, Lineage
Describe the bug Trino is case insensitive for any table / view identifier and also for columns. It also converts everything to lowercase. Unfortunately the source system connected to trino could be case sensitive.
When now using the Trino Lineage ingestion agent with crossDatabaseServiceNames to connect lineages beetween trino and the source system, the lookup is done case sensistive and is comparing lowercase Trino FQNs with potential Upper Case FQNs from the source system.
To Reproduce
- Configure Trino Lineage ingestion with crossDatabaseServiceNames
- Source Database connected in Openmetadata and Trino should use Uppercase table or view identifier
Expected behavior
Respect the Trino behaviour of case insensitivity. Cross Database Lineage should be established when source system is using UpperCase letters in its table names.
Version:
- OpenMetadata Ingestion package version: 1.10.0+
Additional context Add any other context about the problem here.
Hi @ulixius9 @wobu I have ingestion all setup and am ready to dive into this. I want to get assign to this. Please do.
Hey @PubChimps may I please work on this I have an idea to fix this! Could you please assign it to me?
Hi @wobu @pmbrull I'd like to work on this issue — could you please assign it to me?
Hi @wobu @ulixius9 @pmbrull @PubChimps 👋 I've analyzed the root cause and have a complete fix ready. Root cause (precise): In lineage_source.py, the cross-database FQN resolution for crossDatabaseServiceNames performs a case-sensitive string match. Since Trino folds all identifiers to lowercase at the engine level, the Trino-ingested FQN (my_schema.my_table) never matches the source system's registered FQN (MY_SCHEMA.MY_TABLE), so the lineage edge is silently dropped. My approach:
Override the cross-database table lookup in the Trino lineage class to normalize both sides of the comparison to lowercase before FQN resolution — respecting Trino's documented case-folding behavior Apply the same normalization to schema, database, and column name components for complete coverage Scope the fix strictly inside the Trino connector — zero impact on other connectors Add unit tests covering uppercase-to-lowercase cross-database matching and a regression test confirming non-cross-database Trino lineage is unaffected
I have already forked the repo and am starting the implementation now. Could you please assign this to me? Thank you! 🙏
@wobu @ulixius9 @pmbrull @PubChimps Hi, I’ve addressed all the bot-reported issues on this PR and pushed the necessary fixes. Could you please apply safe to test? Thank you!