mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Fix finalize chain logic in ExpressionAnalysisResult (#10302)
This commit is contained in:
parent
15dc45b9b2
commit
ce372f464b
@ -963,13 +963,15 @@ ExpressionAnalysisResult::ExpressionAnalysisResult(
|
||||
|
||||
auto finalize_chain = [&](ExpressionActionsChain & chain)
|
||||
{
|
||||
chain.finalize();
|
||||
|
||||
if (!finalized)
|
||||
{
|
||||
chain.finalize();
|
||||
finalize(chain, context, where_step_num);
|
||||
chain.clear();
|
||||
finalized = true;
|
||||
}
|
||||
finalized = true;
|
||||
|
||||
chain.clear();
|
||||
};
|
||||
|
||||
{
|
||||
|
@ -0,0 +1,9 @@
|
||||
1 0
|
||||
1 1
|
||||
2 0
|
||||
2 1
|
||||
1 0
|
||||
1 1
|
||||
2 0
|
||||
2 1
|
||||
200000
|
24
tests/queries/0_stateless/01117_chain_finalize_bug.sql
Normal file
24
tests/queries/0_stateless/01117_chain_finalize_bug.sql
Normal file
@ -0,0 +1,24 @@
|
||||
SELECT arrayJoin(arrayMap(i -> (i + 1), range(2))) AS index, number
|
||||
FROM numbers(2)
|
||||
GROUP BY number
|
||||
ORDER BY index, number;
|
||||
|
||||
SET max_bytes_before_external_group_by = 1;
|
||||
|
||||
SELECT arrayJoin(arrayMap(i -> (i + 1), range(2))) AS index, number
|
||||
FROM numbers(2)
|
||||
GROUP BY number
|
||||
ORDER BY index, number;
|
||||
|
||||
SET group_by_two_level_threshold = 2;
|
||||
|
||||
SELECT count() FROM
|
||||
(
|
||||
SELECT
|
||||
arrayJoin(arrayMap(i -> (i + 1), range(2))) AS index,
|
||||
number
|
||||
FROM numbers_mt(100000)
|
||||
GROUP BY number
|
||||
ORDER BY index ASC
|
||||
SETTINGS max_block_size = 100000, max_threads = 2
|
||||
);
|
Loading…
Reference in New Issue
Block a user