mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Merge pull request #25801 from azat/storage-merge-no-col-fix
Fix "No available columns" for Merge() storage
This commit is contained in:
commit
5b21ca72ac
@ -742,7 +742,7 @@ void TreeRewriterResult::collectUsedColumns(const ASTPtr & query, bool is_select
|
||||
|
||||
if (!columns.empty())
|
||||
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.
|
||||
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