Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Interpreters/InterpreterShowTablesQuery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,10 @@ BlockIO InterpreterShowTablesQuery::execute()
}
auto rewritten_query = getRewrittenQuery();
String database = getContext()->resolveDatabase(query.getFrom());
if (DatabaseCatalog::instance().isDatalakeCatalog(database))
if (query.databases || DatabaseCatalog::instance().isDatalakeCatalog(database))
{
auto context_copy = Context::createCopy(getContext());
/// HACK To always show them in explicit "SHOW TABLES" queries
/// HACK To always show them in explicit "SHOW TABLES" and "SHOW DATABASES" queries
context_copy->setSetting("show_data_lake_catalogs_in_system_tables", true);
return executeQuery(rewritten_query, context_copy, QueryFlags{ .internal = true }).second;
}
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/test_database_glue/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,8 @@ def test_system_tables(started_cluster):
node.query(f"SELECT count() FROM {CATALOG_NAME}.`{namespace}.{table_name}`")
)

assert CATALOG_NAME in node.query("SHOW DATABASES")
assert table_name in node.query(f"SHOW TABLES FROM {CATALOG_NAME}")
# system.tables
assert int(node.query(f"SELECT count() FROM system.tables WHERE database = '{CATALOG_NAME}' and table ilike '%{root_namespace}%' SETTINGS show_data_lake_catalogs_in_system_tables = true").strip()) == 4
assert int(node.query(f"SELECT count() FROM system.tables WHERE database = '{CATALOG_NAME}' and table ilike '%{root_namespace}%'").strip()) == 0
Expand Down
Loading