Skip to content

chore(ibis-server): use LEFT JOIN for table_comments in Trino metadata to avoid missing tables#1445

Merged
goldmedal merged 1 commit intoCanner:mainfrom
okayhooni:chore/left_join_to_cover_tbl_without_desc
Mar 14, 2026
Merged

chore(ibis-server): use LEFT JOIN for table_comments in Trino metadata to avoid missing tables#1445
goldmedal merged 1 commit intoCanner:mainfrom
okayhooni:chore/left_join_to_cover_tbl_without_desc

Conversation

@okayhooni
Copy link
Copy Markdown
Contributor

@okayhooni okayhooni commented Mar 12, 2026

Problem

Tables missing from the Trino metadata listing when system.metadata.table_comments has no entry for a given catalog.

This commonly occurs with Trino's catalog redirection (e.g., Hive → Iceberg migration): information_schema.tables/columns correctly resolve the redirected table under the target catalog, but system.metadata.table_comments retains the entry only under the original catalog. The INNER JOIN causes these tables to silently disappear from the list.

Fix

Change INNER JOIN system.metadata.table_commentsLEFT JOIN so that tables without a comment entry are still returned (with NULL description).

Summary by CodeRabbit

Bug Fixes

  • Improved Trino data type support with correct mappings for timestamp variants, time types, and intervals, reducing type-related errors when querying and displaying data.
  • Enhanced table metadata retrieval to display all tables, including those without explicit comments, so metadata views now show tables even when comment entries are missing.

@github-actions github-actions bot added ibis python Pull requests that update Python code labels Mar 12, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 012e7c40-d456-45d3-8adc-17c78789fbec

📥 Commits

Reviewing files that changed from the base of the PR and between 2c5b71c and 04dae23.

📒 Files selected for processing (1)
  • ibis-server/app/model/metadata/trino.py

📝 Walkthrough

Walkthrough

Changed 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 system.metadata.table_comments.

Changes

Cohort / File(s) Summary
Trino metadata query
ibis-server/app/model/metadata/trino.py
Replaced INNER JOIN with LEFT JOIN for system.metadata.table_comments in get_table_list, allowing tables without comments to appear in results.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

ibis, python

Suggested reviewers

  • goldmedal
  • douenergy

Poem

🐰 I hopped through joins both near and long,
Switched to LEFT to right a small wrong,
Now tables appear, though comments are few,
A little hop, and the view feels new. 🌿

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: replacing INNER JOIN with LEFT JOIN for table_comments to prevent tables without comment entries from being excluded.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between fc1c54b and 2c5b71c.

📒 Files selected for processing (1)
  • ibis-server/app/model/metadata/trino.py

@okayhooni okayhooni force-pushed the chore/left_join_to_cover_tbl_without_desc branch from 2c5b71c to 04dae23 Compare March 12, 2026 06:19
Copy link
Copy Markdown
Contributor

@goldmedal goldmedal left a comment

Choose a reason for hiding this comment

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

Thanks @okayhooni 👍

@goldmedal goldmedal merged commit 57f9a15 into Canner:main Mar 14, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ibis python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants