mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Fix filtering by tuple (some conditions was lost during analyzing)
Fixes: #29281 Fixes: test_cluster_copier/test_three_nodes.py::test
This commit is contained in:
parent
a95c28ec4b
commit
6c33eaee32
@ -158,7 +158,7 @@ bool MergeTreeWhereOptimizer::tryAnalyzeTuple(Conditions & res, const ASTFunctio
|
||||
else if (const auto * child_ident = child->as<ASTIdentifier>())
|
||||
fetch_sign_column = std::make_shared<ASTIdentifier>(child_ident->name());
|
||||
else
|
||||
continue;
|
||||
return false;
|
||||
|
||||
ASTPtr fetch_sign_value = std::make_shared<ASTLiteral>(tuple_lit.at(i));
|
||||
ASTPtr func_node = makeASTFunction("equals", fetch_sign_column, fetch_sign_value);
|
||||
|
@ -6,4 +6,3 @@
|
||||
1 A 2021-01-01
|
||||
1 A 2021-01-01
|
||||
1 A 2021-01-01
|
||||
1 A 2021-01-01
|
||||
|
@ -11,7 +11,12 @@ SELECT * FROM test_tuple_filter WHERE (1, 'A') = (id, value);
|
||||
SELECT * FROM test_tuple_filter WHERE (id, value) = (1, 'A') AND (id, log_date) = (1, '2021-01-01');
|
||||
SELECT * FROM test_tuple_filter WHERE ((id, value), id * 2) = ((1, 'A'), 2);
|
||||
SELECT * FROM test_tuple_filter WHERE ((id, value), log_date) = ((1, 'A'), '2021-01-01');
|
||||
SELECT * FROM test_tuple_filter WHERE (1, (1, (1, (1, (id, value))))) = (1, (1, (1, (1, (1, 'A')))));
|
||||
|
||||
-- not supported functions (concat) do not lost
|
||||
SELECT * FROM test_tuple_filter WHERE (id, value, value||'foo') = ('1', 'A', 'A');
|
||||
|
||||
-- Condition fully moved to PREWHERE and such conditions does not supported yet.
|
||||
SELECT * FROM test_tuple_filter WHERE (1, (1, (1, (1, (id, value))))) = (1, (1, (1, (1, (1, 'A'))))); -- { serverError INDEX_NOT_USED }
|
||||
|
||||
-- not implemented yet
|
||||
SELECT * FROM test_tuple_filter WHERE (1, value) = (id, 'A'); -- { serverError INDEX_NOT_USED }
|
||||
|
Loading…
Reference in New Issue
Block a user