Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
0218ccb8
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
0218ccb8
编写于
5月 06, 2020
作者:
A
alexey-milovidov
提交者:
Nikolai Kochetov
6月 08, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Merge pull request #10664 from ClickHouse/fix-10655
Fix 10655 (cherry picked from commit
e4b3234d
)
上级
4fb7dc90
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
6 deletion
+19
-6
src/Processors/Transforms/MergingAggregatedMemoryEfficientTransform.cpp
.../Transforms/MergingAggregatedMemoryEfficientTransform.cpp
+7
-3
src/Processors/Transforms/MergingAggregatedMemoryEfficientTransform.h
...rs/Transforms/MergingAggregatedMemoryEfficientTransform.h
+9
-3
tests/performance/distributed_aggregation_memory_efficient.xml
.../performance/distributed_aggregation_memory_efficient.xml
+3
-0
未找到文件。
src/Processors/Transforms/MergingAggregatedMemoryEfficientTransform.cpp
浏览文件 @
0218ccb8
...
...
@@ -27,6 +27,8 @@ GroupingAggregatedTransform::GroupingAggregatedTransform(
void
GroupingAggregatedTransform
::
readFromAllInputs
()
{
auto
in
=
inputs
.
begin
();
read_from_all_inputs
=
true
;
for
(
size_t
i
=
0
;
i
<
num_inputs
;
++
i
,
++
in
)
{
if
(
in
->
isFinished
())
...
...
@@ -38,14 +40,15 @@ void GroupingAggregatedTransform::readFromAllInputs()
in
->
setNeeded
();
if
(
!
in
->
hasData
())
return
;
{
read_from_all_inputs
=
false
;
continue
;
}
auto
chunk
=
in
->
pull
();
read_from_input
[
i
]
=
true
;
addChunk
(
std
::
move
(
chunk
),
i
);
}
read_from_all_inputs
=
true
;
}
void
GroupingAggregatedTransform
::
pushData
(
Chunks
chunks
,
Int32
bucket
,
bool
is_overflows
)
...
...
@@ -269,6 +272,7 @@ void GroupingAggregatedTransform::addChunk(Chunk chunk, size_t input)
void
GroupingAggregatedTransform
::
work
()
{
/// Convert single level data to two level.
if
(
!
single_level_chunks
.
empty
())
{
auto
&
header
=
getInputs
().
front
().
getHeader
();
...
...
src/Processors/Transforms/MergingAggregatedMemoryEfficientTransform.h
浏览文件 @
0218ccb8
...
...
@@ -28,11 +28,11 @@ private:
size_t
num_inputs
;
AggregatingTransformParamsPtr
params
;
std
::
vector
<
Int32
>
last_bucket_number
;
std
::
map
<
Int32
,
Chunks
>
chunks_map
;
std
::
vector
<
Int32
>
last_bucket_number
;
/// Last bucket read from each input.
std
::
map
<
Int32
,
Chunks
>
chunks_map
;
/// bucket -> chunks
Chunks
overflow_chunks
;
Chunks
single_level_chunks
;
Int32
current_bucket
=
0
;
Int32
current_bucket
=
0
;
/// Currently processing bucket.
Int32
next_bucket_to_push
=
0
;
/// Always <= current_bucket.
bool
has_two_level
=
false
;
...
...
@@ -42,11 +42,17 @@ private:
bool
expect_several_chunks_for_single_bucket_per_source
=
false
;
/// Add chunk read from input to chunks_map, overflow_chunks or single_level_chunks according to it's chunk info.
void
addChunk
(
Chunk
chunk
,
size_t
input
);
/// Read from all inputs first chunk. It is needed to detect if any source has two-level aggregation.
void
readFromAllInputs
();
/// Push chunks if all inputs has single level.
bool
tryPushSingleLevelData
();
/// Push chunks from ready bucket if has one.
bool
tryPushTwoLevelData
();
/// Push overflow chunks if has any.
bool
tryPushOverflowData
();
/// Push chunks from bucket to output port.
void
pushData
(
Chunks
chunks
,
Int32
bucket
,
bool
is_overflows
);
};
...
...
tests/performance/distributed_aggregation_memory_efficient.xml
0 → 100644
浏览文件 @
0218ccb8
<test>
<query>
select sum(number) from remote('127.0.0{2,3,4,5}', numbers_mt(1000000000)) settings max_threads=4, distributed_aggregation_memory_efficient=1
</query>
</test>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录