Skip to content

Antalya 26.3: DataLakeCatalog: avoid full catalog read for UNKNOWN_TABLE typo hints#1675

Open
zvonand wants to merge 1 commit intoantalya-26.3from
feature/antalya-26.3/ClickHouse-ClickHouse-pr-100452
Open

Antalya 26.3: DataLakeCatalog: avoid full catalog read for UNKNOWN_TABLE typo hints#1675
zvonand wants to merge 1 commit intoantalya-26.3from
feature/antalya-26.3/ClickHouse-ClickHouse-pr-100452

Conversation

@zvonand
Copy link
Copy Markdown
Collaborator

@zvonand zvonand commented Apr 22, 2026

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Avoid scanning the whole remote data lake catalog for “Maybe you meant …” table hints when show_data_lake_catalogs_in_system_tables is disabled (ClickHouse#100452 by @alsugiliazova).

Cherry-picked from ClickHouse#100452.


Documentation entry for user-facing changes

When show_data_lake_catalogs_in_system_tables = 0, the server must not implicitly scan the whole remote data lake catalog.
Previously, building the “Maybe you meant …” hint for a missing table in a DataLakeCatalog database still called getAllTableNames()DatabaseDataLake::getTablesIterator(), which lists the entire catalog and loads per-table metadata—heavy work and can OOM on large catalogs, only to enrich an error message.

This change makes TableNameHints::getAllRegisteredNames() return an empty name list for data lake catalogs when that setting is off, so hint generation does not trigger a full catalog listing.

Query examples

SET show_data_lake_catalogs_in_system_tables = 0;

Drop non-existent table:

DROP TABLE datalake.`schema1.table1`;

Previously (undesired): server could answer with UNKNOWN_TABLE and a “Maybe you meant …” suggestion after scanning catalog names:

Received exception from server (version 26.3.1):
Code: 60. DB::Exception: Received from localhost:9000. DB::Exception: Table datalake.`schema1.table1` does not exist. Maybe you meant datalake.`schema1.table`?. (UNKNOWN_TABLE)

After the fix: UNKNOWN_TABLE without hint when the setting is 0:

Received exception from server (version 26.4.1):
Code: 60. DB::Exception: Received from localhost:9000. DB::Exception: Table datalake.`schema1.table1` does not exist. (UNKNOWN_TABLE)

Optional follow-up

If local hints are skipped for data lake + setting 0, getHintForTable can still fall back to getExtendedHintForTable, which only scans non–data-lake databases. In edge cases a suggestion could point at another database’s table. If that is undesirable, a follow-up could skip extended hints under the same condition as local enumeration.

…n_drop

DataLakeCatalog: avoid full catalog read for `UNKNOWN_TABLE` typo hints
@zvonand zvonand added the releasy Created/managed by RelEasy label Apr 22, 2026
@github-actions
Copy link
Copy Markdown

Workflow [PR], commit [5af1168]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releasy Created/managed by RelEasy

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants