mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Merge pull request #45133 from ClickHouse/fix-additinal-tables-filter-with-count-projection
Fix additional_table_filters with minmax/count projection.
This commit is contained in:
commit
d0c1079242
@ -6052,6 +6052,10 @@ std::optional<ProjectionCandidate> MergeTreeData::getQueryProcessingStageWithAgg
|
|||||||
if (settings.parallel_replicas_count > 1 || settings.max_parallel_replicas > 1)
|
if (settings.parallel_replicas_count > 1 || settings.max_parallel_replicas > 1)
|
||||||
return std::nullopt;
|
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 query_ptr = query_info.original_query;
|
||||||
auto * select_query = query_ptr->as<ASTSelectQuery>();
|
auto * select_query = query_ptr->as<ASTSelectQuery>();
|
||||||
if (!select_query)
|
if (!select_query)
|
||||||
|
@ -1 +1,2 @@
|
|||||||
0 0 0
|
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'};
|
SELECT count(), min(a), max(a) FROM t SETTINGS additional_table_filters = {'t' : '0'};
|
||||||
|
|
||||||
DROP TABLE t;
|
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