Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
9ce0607d
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,发现更多精彩内容 >>
提交
9ce0607d
编写于
4月 13, 2020
作者:
N
Nikolai Kochetov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove header from AggregatingSortedAlgorithm.
上级
0544c1f2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
15 deletion
+18
-15
src/Processors/Merges/AggregatingSortedAlgorithm.cpp
src/Processors/Merges/AggregatingSortedAlgorithm.cpp
+5
-6
src/Processors/Merges/AggregatingSortedAlgorithm.h
src/Processors/Merges/AggregatingSortedAlgorithm.h
+13
-9
未找到文件。
src/Processors/Merges/AggregatingSortedAlgorithm.cpp
浏览文件 @
9ce0607d
...
...
@@ -48,7 +48,7 @@ namespace
type
=
nullptr
;
// simple aggregate function
AggregatingSortedAlgorithm
::
SimpleAggregateDescription
desc
(
simple_aggr
->
getFunction
(),
i
,
type
);
AggregatingSortedAlgorithm
::
SimpleAggregateDescription
desc
(
simple_aggr
->
getFunction
(),
i
,
type
,
column
.
type
);
if
(
desc
.
function
->
allocatesMemoryInArena
())
def
.
allocates_memory_in_arena
=
true
;
...
...
@@ -84,10 +84,9 @@ namespace
}
AggregatingSortedAlgorithm
::
AggregatingSortedAlgorithm
(
const
Block
&
header
_
,
size_t
num_inputs
,
const
Block
&
header
,
size_t
num_inputs
,
SortDescription
description_
,
size_t
max_block_size
)
:
IMergingAlgorithmWithDelayedChunk
(
num_inputs
,
std
::
move
(
description_
))
,
header
(
header_
)
,
columns_definition
(
defineColumns
(
header
,
description_
))
,
merged_data
(
getMergedColumns
(
header
,
columns_definition
),
max_block_size
,
columns_definition
)
{
...
...
@@ -102,7 +101,7 @@ void AggregatingSortedAlgorithm::prepareChunk(Chunk & chunk) const
column
=
column
->
convertToFullColumnIfConst
();
for
(
auto
&
desc
:
columns_definition
.
columns_to_simple_aggregate
)
if
(
desc
.
inner
_type
)
if
(
desc
.
nested
_type
)
columns
[
desc
.
column_number
]
=
recursiveRemoveLowCardinality
(
columns
[
desc
.
column_number
]);
chunk
.
setColumns
(
std
::
move
(
columns
),
num_rows
);
...
...
@@ -159,7 +158,7 @@ IMergingAlgorithm::Status AggregatingSortedAlgorithm::merge()
if
(
merged_data
.
hasEnoughRows
())
{
last_key
.
reset
();
Status
(
merged_data
.
pull
(
columns_definition
,
header
));
Status
(
merged_data
.
pull
(
columns_definition
));
}
/// We will write the data for the group. We copy the values of ordinary columns.
...
...
@@ -200,7 +199,7 @@ IMergingAlgorithm::Status AggregatingSortedAlgorithm::merge()
}
last_chunk_sort_columns
.
clear
();
return
Status
(
merged_data
.
pull
(
columns_definition
,
header
),
true
);
return
Status
(
merged_data
.
pull
(
columns_definition
),
true
);
}
void
AggregatingSortedAlgorithm
::
addRow
(
SortCursor
&
cursor
)
...
...
src/Processors/Merges/AggregatingSortedAlgorithm.h
浏览文件 @
9ce0607d
...
...
@@ -72,7 +72,7 @@ private:
/// TODO: sum_blocks_granularity += block_size;
}
Chunk
pull
(
ColumnsDefinition
&
def
,
const
Block
&
header_
)
Chunk
pull
(
ColumnsDefinition
&
def
)
{
auto
chunk
=
pull
();
...
...
@@ -81,10 +81,10 @@ private:
for
(
auto
&
desc
:
def
.
columns_to_simple_aggregate
)
{
if
(
desc
.
inner
_type
)
if
(
desc
.
nested
_type
)
{
auto
&
from_type
=
desc
.
inner
_type
;
auto
&
to_type
=
header_
.
getByPosition
(
desc
.
column_number
).
type
;
auto
&
from_type
=
desc
.
nested
_type
;
auto
&
to_type
=
desc
.
real_
type
;
columns_
[
desc
.
column_number
]
=
recursiveTypeConversion
(
columns_
[
desc
.
column_number
],
from_type
,
to_type
);
}
}
...
...
@@ -111,8 +111,6 @@ private:
using
MergedData
::
pull
;
};
Block
header
;
ColumnsDefinition
columns_definition
;
AggregatingMergedData
merged_data
;
...
...
@@ -134,13 +132,19 @@ public:
size_t
column_number
=
0
;
IColumn
*
column
=
nullptr
;
const
DataTypePtr
inner_type
;
/// For LowCardinality, convert is converted to nested type. nested_type is nullptr if no conversion needed.
const
DataTypePtr
nested_type
;
/// Nested type for LowCardinality, if it is.
const
DataTypePtr
real_type
;
/// Type in header.
AlignedBuffer
state
;
bool
created
=
false
;
SimpleAggregateDescription
(
AggregateFunctionPtr
function_
,
const
size_t
column_number_
,
DataTypePtr
type
)
:
function
(
std
::
move
(
function_
)),
column_number
(
column_number_
),
inner_type
(
std
::
move
(
type
))
SimpleAggregateDescription
(
AggregateFunctionPtr
function_
,
const
size_t
column_number_
,
DataTypePtr
nested_type_
,
DataTypePtr
real_type_
)
:
function
(
std
::
move
(
function_
)),
column_number
(
column_number_
)
,
nested_type
(
std
::
move
(
nested_type_
)),
real_type
(
std
::
move
(
real_type_
))
{
add_function
=
function
->
getAddressOfAddFunction
();
state
.
reset
(
function
->
sizeOfData
(),
function
->
alignOfData
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录