chore(ibis-server): use LEFT JOIN for table_comments in Trino metadata to avoid missing tables#1445
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughChanged the SQL join in Trino metadata query from INNER JOIN to LEFT JOIN in get_table_list so table rows are returned even when there is no matching row in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ibis-server/app/model/metadata/trino.py`:
- Line 52: The current exact lookup for interval types in _transform_column_type
misses Trino's qualified names like "interval day to second" or "interval year
to month"; update the logic in _transform_column_type to normalize the input
(lowercase, strip any trailing "(...)" already handled) and then either add
explicit keys for Trino spellings (e.g., "interval day to second", "interval
year to month") to the mapping that includes RustWrenEngineColumnType.INTERVAL,
or change the lookup to a prefix match: if
normalized_type.startswith("interval") return RustWrenEngineColumnType.INTERVAL;
keep the existing exact-match fallback for other types.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 82326c63-f65d-4c3a-b95d-444deb1ab40f
📒 Files selected for processing (1)
ibis-server/app/model/metadata/trino.py
2c5b71c to
04dae23
Compare
Problem
Tables missing from the Trino metadata listing when
system.metadata.table_commentshas no entry for a given catalog.This commonly occurs with Trino's catalog redirection (e.g., Hive → Iceberg migration):
information_schema.tables/columnscorrectly resolve the redirected table under the target catalog, butsystem.metadata.table_commentsretains the entry only under the original catalog. TheINNER JOINcauses these tables to silently disappear from the list.Fix
Change
INNER JOIN system.metadata.table_comments→LEFT JOINso that tables without a comment entry are still returned (withNULLdescription).Summary by CodeRabbit
Bug Fixes