mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
Use existing alias as external table name
This commit is contained in:
parent
a3944624a0
commit
dc49303baf
@ -78,12 +78,16 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
/// Generate the name for the external table.
|
||||
String external_table_name = "_data" + toString(external_table_id);
|
||||
while (external_tables.count(external_table_name))
|
||||
String external_table_name = subquery_or_table_name->tryGetAlias();
|
||||
if (external_table_name.empty())
|
||||
{
|
||||
++external_table_id;
|
||||
/// Generate the name for the external table.
|
||||
external_table_name = "_data" + toString(external_table_id);
|
||||
while (external_tables.count(external_table_name))
|
||||
{
|
||||
++external_table_id;
|
||||
external_table_name = "_data" + toString(external_table_id);
|
||||
}
|
||||
}
|
||||
|
||||
auto interpreter = interpretSubquery(subquery_or_table_name, context, subquery_depth, {});
|
||||
|
Loading…
Reference in New Issue
Block a user