mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Fixed error in prev. revision [#CLICKHOUSE-3806]
This commit is contained in:
parent
88c582106b
commit
67b9a69f19
@ -52,17 +52,27 @@ StorageMerge::StorageMerge(
|
||||
|
||||
NameAndTypePair StorageMerge::getColumn(const String & column_name) const
|
||||
{
|
||||
/// virtual column of the Merge table itself
|
||||
if (column_name == "_table")
|
||||
return { column_name, std::make_shared<DataTypeString>() };
|
||||
|
||||
/// virtual (and real) columns of the underlying tables
|
||||
auto first_table = getFirstTable([](auto &&) { return true; });
|
||||
if (first_table)
|
||||
return first_table->getColumn(column_name);
|
||||
|
||||
return IStorage::getColumn(column_name);
|
||||
}
|
||||
|
||||
bool StorageMerge::hasColumn(const String & column_name) const
|
||||
{
|
||||
if (column_name == "_table")
|
||||
return true;
|
||||
|
||||
auto first_table = getFirstTable([](auto &&) { return true; });
|
||||
if (first_table)
|
||||
return first_table->hasColumn(column_name);
|
||||
|
||||
return IStorage::hasColumn(column_name);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user