This commit is contained in:
Igor Nikonov 2024-09-02 12:37:53 +00:00
parent d1bf8d7bfe
commit 4b4976c9b0
2 changed files with 9 additions and 5 deletions

View File

@ -1287,7 +1287,8 @@ void Planner::buildPlanForUnionNode()
for (const auto & query_node : union_queries_nodes)
{
Planner query_planner(query_node, select_query_options);
Planner query_planner(query_node, select_query_options, planner_context->getGlobalPlannerContext());
query_planner.buildQueryPlanIfNeeded();
for (const auto & row_policy : query_planner.getUsedRowPolicies())
used_row_policies.insert(row_policy);

View File

@ -1,6 +1,4 @@
SET allow_experimental_parallel_reading_from_replicas=1, max_parallel_replicas=3, cluster_for_parallel_replicas='test_cluster_one_shard_three_replicas_localhost';
DROP TABLE IF EXISTS test_table;
DROP TABLE IF EXISTS test_table SYNC;
CREATE TABLE test_table
(
id UInt64,
@ -9,7 +7,7 @@ CREATE TABLE test_table
INSERT INTO test_table VALUES (0, 'Value_0'), (1, 'Value_1'), (2, 'Value_2');
DROP TABLE IF EXISTS test_table_for_in;
DROP TABLE IF EXISTS test_table_for_in SYNC;
CREATE TABLE test_table_for_in
(
id UInt64
@ -17,4 +15,9 @@ CREATE TABLE test_table_for_in
INSERT INTO test_table_for_in VALUES (0), (1);
SET allow_experimental_parallel_reading_from_replicas=1, max_parallel_replicas=3, cluster_for_parallel_replicas='test_cluster_one_shard_three_replicas_localhost';
SELECT id, value FROM test_table WHERE id IN (SELECT id FROM test_table_for_in UNION DISTINCT SELECT id FROM test_table_for_in);
DROP TABLE test_table SYNC;
DROP TABLE test_table_for_in SYNC;