mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fix "No available columns" for Merge() storage
This commit is contained in:
parent
d9c46003cb
commit
15a14d6da2
@ -742,7 +742,7 @@ void TreeRewriterResult::collectUsedColumns(const ASTPtr & query, bool is_select
|
|||||||
|
|
||||||
if (!columns.empty())
|
if (!columns.empty())
|
||||||
required.insert(std::min_element(columns.begin(), columns.end())->name);
|
required.insert(std::min_element(columns.begin(), columns.end())->name);
|
||||||
else
|
else if (!source_columns.empty())
|
||||||
/// If we have no information about columns sizes, choose a column of minimum size of its data type.
|
/// If we have no information about columns sizes, choose a column of minimum size of its data type.
|
||||||
required.insert(ExpressionActions::getSmallestColumn(source_columns));
|
required.insert(ExpressionActions::getSmallestColumn(source_columns));
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
drop table if exists data;
|
||||||
|
create table data (key Int) engine=MergeTree() order by key;
|
||||||
|
select 1 from merge(currentDatabase(), '^data$') prewhere _table in (NULL);
|
||||||
|
drop table data;
|
Loading…
Reference in New Issue
Block a user