mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 01:00:48 +00:00
Fix additional_table_filters with minmax/count projection.
This commit is contained in:
parent
0a60fe6e60
commit
9a81f27fb2
@ -5960,6 +5960,10 @@ std::optional<ProjectionCandidate> MergeTreeData::getQueryProcessingStageWithAgg
|
||||
if (settings.parallel_replicas_count > 1 || settings.max_parallel_replicas > 1)
|
||||
return std::nullopt;
|
||||
|
||||
/// Cannot use projections in case of additional filter.
|
||||
if (query_info.additional_filter_ast)
|
||||
return std::nullopt;
|
||||
|
||||
auto query_ptr = query_info.original_query;
|
||||
auto * select_query = query_ptr->as<ASTSelectQuery>();
|
||||
if (!select_query)
|
||||
|
@ -1 +1,2 @@
|
||||
0 0 0
|
||||
3
|
||||
|
@ -7,3 +7,9 @@ INSERT INTO t SELECT number % 10, number FROM numbers(10000);
|
||||
SELECT count(), min(a), max(a) FROM t SETTINGS additional_table_filters = {'t' : '0'};
|
||||
|
||||
DROP TABLE t;
|
||||
|
||||
drop table if exists atf_p;
|
||||
create table atf_p (x UInt64) engine = MergeTree order by tuple();
|
||||
insert into atf_p select number from numbers(10);
|
||||
select count() from atf_p settings additional_table_filters = {'atf_p': 'x <= 2'};
|
||||
drop table atf_p;
|
||||
|
Loading…
Reference in New Issue
Block a user