Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
ca01094f
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,发现更多精彩内容 >>
提交
ca01094f
编写于
6月 24, 2020
作者:
N
Nikolai Kochetov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
More actions description.
上级
d88e19b6
变更
39
隐藏空白更改
内联
并排
Showing
39 changed file
with
368 addition
and
56 deletion
+368
-56
src/Core/SortDescription.cpp
src/Core/SortDescription.cpp
+41
-0
src/Core/SortDescription.h
src/Core/SortDescription.h
+3
-0
src/Core/ya.make
src/Core/ya.make
+1
-0
src/Interpreters/AggregateDescription.cpp
src/Interpreters/AggregateDescription.cpp
+32
-30
src/Interpreters/Aggregator.cpp
src/Interpreters/Aggregator.cpp
+18
-6
src/Interpreters/InterpreterSelectQuery.cpp
src/Interpreters/InterpreterSelectQuery.cpp
+2
-2
src/Processors/QueryPlan/ConvertingStep.cpp
src/Processors/QueryPlan/ConvertingStep.cpp
+30
-0
src/Processors/QueryPlan/ConvertingStep.h
src/Processors/QueryPlan/ConvertingStep.h
+2
-0
src/Processors/QueryPlan/CreatingSetsStep.cpp
src/Processors/QueryPlan/CreatingSetsStep.cpp
+17
-0
src/Processors/QueryPlan/CreatingSetsStep.h
src/Processors/QueryPlan/CreatingSetsStep.h
+2
-0
src/Processors/QueryPlan/DistinctStep.cpp
src/Processors/QueryPlan/DistinctStep.cpp
+14
-0
src/Processors/QueryPlan/DistinctStep.h
src/Processors/QueryPlan/DistinctStep.h
+2
-0
src/Processors/QueryPlan/ExpressionStep.cpp
src/Processors/QueryPlan/ExpressionStep.cpp
+20
-0
src/Processors/QueryPlan/ExpressionStep.h
src/Processors/QueryPlan/ExpressionStep.h
+4
-0
src/Processors/QueryPlan/FillingStep.cpp
src/Processors/QueryPlan/FillingStep.cpp
+5
-0
src/Processors/QueryPlan/FillingStep.h
src/Processors/QueryPlan/FillingStep.h
+2
-0
src/Processors/QueryPlan/FilterStep.cpp
src/Processors/QueryPlan/FilterStep.cpp
+12
-0
src/Processors/QueryPlan/FilterStep.h
src/Processors/QueryPlan/FilterStep.h
+2
-0
src/Processors/QueryPlan/FinishSortingStep.cpp
src/Processors/QueryPlan/FinishSortingStep.cpp
+13
-0
src/Processors/QueryPlan/FinishSortingStep.h
src/Processors/QueryPlan/FinishSortingStep.h
+2
-0
src/Processors/QueryPlan/LimitByStep.cpp
src/Processors/QueryPlan/LimitByStep.cpp
+19
-0
src/Processors/QueryPlan/LimitByStep.h
src/Processors/QueryPlan/LimitByStep.h
+2
-0
src/Processors/QueryPlan/LimitStep.cpp
src/Processors/QueryPlan/LimitStep.cpp
+26
-0
src/Processors/QueryPlan/LimitStep.h
src/Processors/QueryPlan/LimitStep.h
+2
-0
src/Processors/QueryPlan/MergeSortingStep.cpp
src/Processors/QueryPlan/MergeSortingStep.cpp
+11
-0
src/Processors/QueryPlan/MergeSortingStep.h
src/Processors/QueryPlan/MergeSortingStep.h
+2
-0
src/Processors/QueryPlan/MergingAggregatedStep.cpp
src/Processors/QueryPlan/MergingAggregatedStep.cpp
+5
-0
src/Processors/QueryPlan/MergingAggregatedStep.h
src/Processors/QueryPlan/MergingAggregatedStep.h
+2
-0
src/Processors/QueryPlan/MergingSortedStep.cpp
src/Processors/QueryPlan/MergingSortedStep.cpp
+10
-0
src/Processors/QueryPlan/MergingSortedStep.h
src/Processors/QueryPlan/MergingSortedStep.h
+2
-0
src/Processors/QueryPlan/OffsetStep.cpp
src/Processors/QueryPlan/OffsetStep.cpp
+8
-3
src/Processors/QueryPlan/OffsetStep.h
src/Processors/QueryPlan/OffsetStep.h
+5
-3
src/Processors/QueryPlan/PartialSortingStep.cpp
src/Processors/QueryPlan/PartialSortingStep.cpp
+10
-0
src/Processors/QueryPlan/PartialSortingStep.h
src/Processors/QueryPlan/PartialSortingStep.h
+2
-0
src/Processors/QueryPlan/QueryPlan.cpp
src/Processors/QueryPlan/QueryPlan.cpp
+2
-11
src/Processors/QueryPlan/TotalsHavingStep.cpp
src/Processors/QueryPlan/TotalsHavingStep.cpp
+31
-0
src/Processors/QueryPlan/TotalsHavingStep.h
src/Processors/QueryPlan/TotalsHavingStep.h
+2
-0
src/Processors/Transforms/ConvertingTransform.h
src/Processors/Transforms/ConvertingTransform.h
+2
-0
src/Processors/ya.make
src/Processors/ya.make
+1
-1
未找到文件。
src/Core/SortDescription.cpp
0 → 100644
浏览文件 @
ca01094f
#include <Core/SortDescription.h>
#include <Core/Block.h>
namespace
DB
{
String
dumpSortDescription
(
const
SortDescription
&
description
,
const
Block
&
header
)
{
String
res
;
for
(
const
auto
&
desc
:
description
)
{
if
(
!
res
.
empty
())
res
+=
", "
;
if
(
!
desc
.
column_name
.
empty
())
res
+=
desc
.
column_name
;
else
{
if
(
desc
.
column_number
<
header
.
columns
())
res
+=
header
.
getByPosition
(
desc
.
column_number
).
name
;
else
res
+=
"?"
;
res
+=
" (pos "
+
std
::
to_string
(
desc
.
column_number
)
+
")"
;
}
if
(
desc
.
direction
>
0
)
res
+=
" ASC"
;
else
res
+=
" DESC"
;
if
(
desc
.
with_fill
)
res
+=
" WITH FILL"
;
}
return
res
;
}
}
src/Core/SortDescription.h
浏览文件 @
ca01094f
...
...
@@ -71,4 +71,7 @@ struct SortColumnDescription
/// Description of the sorting rule for several columns.
using
SortDescription
=
std
::
vector
<
SortColumnDescription
>
;
class
Block
;
String
dumpSortDescription
(
const
SortDescription
&
description
,
const
Block
&
header
);
}
src/Core/ya.make
浏览文件 @
ca01094f
...
...
@@ -20,6 +20,7 @@ SRCS(
NamesAndTypes.cpp
Settings.cpp
SettingsCollection.cpp
SortDescription.cpp
)
END()
src/Interpreters/AggregateDescription.cpp
浏览文件 @
ca01094f
...
...
@@ -7,34 +7,8 @@ namespace DB
Strings
AggregateDescription
::
explain
()
const
{
Strings
res
;
String
arguments_pos_str
;
for
(
auto
arg
:
arguments
)
{
if
(
!
arguments_pos_str
.
empty
())
arguments_pos_str
+=
", "
;
arguments_pos_str
+=
std
::
to_string
(
arg
);
}
if
(
arguments_pos_str
.
empty
())
arguments_pos_str
=
"none"
;
res
.
emplace_back
(
"argument positions: "
+
arguments_pos_str
);
String
arguments_names_str
;
for
(
const
auto
&
arg
:
argument_names
)
{
if
(
!
arguments_names_str
.
empty
())
arguments_names_str
+=
", "
;
arguments_names_str
+=
arg
;
}
if
(
arguments_names_str
.
empty
())
arguments_names_str
=
"none"
;
res
.
emplace_back
(
"arguments: "
+
arguments_names_str
);
res
.
emplace_back
(
"column_name: "
+
column_name
);
res
.
emplace_back
(
column_name
);
auto
get_params_string
=
[](
const
Array
&
arr
)
{
...
...
@@ -65,14 +39,42 @@ Strings AggregateDescription::explain() const
if
(
!
params_str
.
empty
())
params_str
=
"("
+
params_str
+
")"
;
res
.
emplace_back
(
"
f
unction: "
+
function
->
getName
()
+
params_str
+
'('
+
types_str
+
") -> "
+
res
.
emplace_back
(
"
F
unction: "
+
function
->
getName
()
+
params_str
+
'('
+
types_str
+
") -> "
+
function
->
getReturnType
()
->
getName
());
}
else
res
.
emplace_back
(
"
f
unction: nullptr"
);
res
.
emplace_back
(
"
F
unction: nullptr"
);
if
(
!
parameters
.
empty
())
res
.
emplace_back
(
"parameters: "
+
get_params_string
(
parameters
));
res
.
emplace_back
(
" Parameters: "
+
get_params_string
(
parameters
));
String
arguments_names_str
;
for
(
const
auto
&
arg
:
argument_names
)
{
if
(
!
arguments_names_str
.
empty
())
arguments_names_str
+=
", "
;
arguments_names_str
+=
arg
;
}
if
(
arguments_names_str
.
empty
())
arguments_names_str
=
"none"
;
res
.
emplace_back
(
" Arguments: "
+
arguments_names_str
);
String
arguments_pos_str
;
for
(
auto
arg
:
arguments
)
{
if
(
!
arguments_pos_str
.
empty
())
arguments_pos_str
+=
", "
;
arguments_pos_str
+=
std
::
to_string
(
arg
);
}
if
(
arguments_pos_str
.
empty
())
arguments_pos_str
=
"none"
;
res
.
emplace_back
(
" Argument positions: "
+
arguments_pos_str
);
return
res
;
}
...
...
src/Interpreters/Aggregator.cpp
浏览文件 @
ca01094f
...
...
@@ -158,21 +158,33 @@ Strings Aggregator::Params::explain() const
String
keys_str
;
for
(
auto
key
:
keys
)
{
if
(
keys_str
.
empty
())
if
(
!
keys_str
.
empty
())
keys_str
+=
", "
;
if
(
key
>=
header
.
columns
())
keys_str
+=
"unknown position "
+
std
::
to_string
(
key
);
else
keys_str
+=
src_
header
.
getByPosition
(
key
).
name
;
keys_str
+=
header
.
getByPosition
(
key
).
name
;
}
res
.
emplace_back
(
"
k
eys: "
+
std
::
move
(
keys_str
));
res
.
emplace_back
(
"
K
eys: "
+
std
::
move
(
keys_str
));
for
(
const
auto
&
aggregate
:
aggregates
)
if
(
!
aggregates
.
empty
()
)
{
auto
aggregate_strings
=
aggregate
.
explain
();
res
.
insert
(
res
.
end
(),
aggregate_strings
.
begin
(),
aggregate_strings
.
end
());
bool
first
=
true
;
for
(
const
auto
&
aggregate
:
aggregates
)
{
auto
aggregate_strings
=
aggregate
.
explain
();
for
(
const
auto
&
aggregate_str
:
aggregate_strings
)
{
if
(
first
)
res
.
emplace_back
(
"Aggregates: "
+
aggregate_str
);
else
res
.
emplace_back
(
" "
+
aggregate_str
);
first
=
false
;
}
}
}
return
res
;
...
...
src/Interpreters/InterpreterSelectQuery.cpp
浏览文件 @
ca01094f
...
...
@@ -53,7 +53,7 @@
#include <Processors/QueryPlan/CubeStep.h>
#include <Processors/QueryPlan/FillingStep.h>
#include <Processors/QueryPlan/ExtremesStep.h>
#include <Processors/QueryPlan/Offset
s
Step.h>
#include <Processors/QueryPlan/OffsetStep.h>
#include <Processors/QueryPlan/FinishSortingStep.h>
#include <Processors/QueryPlan/QueryPlan.h>
...
...
@@ -1792,7 +1792,7 @@ void InterpreterSelectQuery::executeOffset(QueryPlan & query_plan)
UInt64
limit_offset
;
std
::
tie
(
limit_length
,
limit_offset
)
=
getLimitLengthAndOffset
(
query
,
*
context
);
auto
offsets_step
=
std
::
make_unique
<
Offset
s
Step
>
(
query_plan
.
getCurrentDataStream
(),
limit_offset
);
auto
offsets_step
=
std
::
make_unique
<
OffsetStep
>
(
query_plan
.
getCurrentDataStream
(),
limit_offset
);
query_plan
.
addStep
(
std
::
move
(
offsets_step
));
}
}
...
...
src/Processors/QueryPlan/ConvertingStep.cpp
浏览文件 @
ca01094f
...
...
@@ -46,4 +46,34 @@ void ConvertingStep::transformPipeline(QueryPipeline & pipeline)
});
}
Strings
ConvertingStep
::
describeActions
()
const
{
const
auto
&
header
=
input_streams
[
0
].
header
;
auto
conversion
=
ConvertingTransform
(
header
,
result_header
,
ConvertingTransform
::
MatchColumnsMode
::
Name
)
.
getConversion
();
Strings
res
;
auto
get_description
=
[](
const
ColumnWithTypeAndName
&
elem
,
bool
is_const
)
{
return
elem
.
name
+
" "
+
elem
.
type
->
getName
()
+
(
is_const
?
" Const"
:
""
);
};
for
(
size_t
i
=
0
;
i
<
conversion
.
size
();
++
i
)
{
const
auto
&
from
=
header
.
getByPosition
(
conversion
[
i
]);
const
auto
&
to
=
result_header
.
getByPosition
(
i
);
bool
from_const
=
from
.
column
&&
isColumnConst
(
*
from
.
column
);
bool
to_const
=
to
.
column
&&
isColumnConst
(
*
to
.
column
);
if
(
from
.
name
==
to
.
name
&&
from
.
type
->
equals
(
*
to
.
type
)
&&
from_const
==
to_const
)
res
.
emplace_back
(
get_description
(
from
,
from_const
));
else
res
.
emplace_back
(
get_description
(
to
,
to_const
)
+
" <- "
+
get_description
(
from
,
from_const
));
}
return
res
;
}
}
src/Processors/QueryPlan/ConvertingStep.h
浏览文件 @
ca01094f
...
...
@@ -13,6 +13,8 @@ public:
void
transformPipeline
(
QueryPipeline
&
pipeline
)
override
;
Strings
describeActions
()
const
override
;
private:
Block
result_header
;
};
...
...
src/Processors/QueryPlan/CreatingSetsStep.cpp
浏览文件 @
ca01094f
...
...
@@ -35,4 +35,21 @@ void CreatingSetsStep::transformPipeline(QueryPipeline & pipeline)
pipeline
.
addCreatingSetsTransform
(
std
::
move
(
creating_sets
));
}
Strings
CreatingSetsStep
::
describeActions
()
const
{
Strings
res
;
for
(
const
auto
&
set
:
subqueries_for_sets
)
{
String
str
;
if
(
set
.
second
.
set
)
str
+=
"Set: "
;
else
if
(
set
.
second
.
join
)
str
+=
"Join: "
;
str
+=
set
.
first
;
}
return
res
;
}
}
src/Processors/QueryPlan/CreatingSetsStep.h
浏览文件 @
ca01094f
...
...
@@ -19,6 +19,8 @@ public:
void
transformPipeline
(
QueryPipeline
&
pipeline
)
override
;
Strings
describeActions
()
const
override
;
private:
SubqueriesForSets
subqueries_for_sets
;
SizeLimits
network_transfer_limits
;
...
...
src/Processors/QueryPlan/DistinctStep.cpp
浏览文件 @
ca01094f
...
...
@@ -65,4 +65,18 @@ void DistinctStep::transformPipeline(QueryPipeline & pipeline)
});
}
Strings
DistinctStep
::
describeActions
()
const
{
String
res
;
for
(
const
auto
&
column
:
columns
)
{
if
(
!
res
.
empty
())
res
+=
", "
;
res
+=
column
;
}
return
{
"Columns: "
+
res
};
}
}
src/Processors/QueryPlan/DistinctStep.h
浏览文件 @
ca01094f
...
...
@@ -19,6 +19,8 @@ public:
void
transformPipeline
(
QueryPipeline
&
pipeline
)
override
;
Strings
describeActions
()
const
override
;
private:
SizeLimits
set_size_limits
;
UInt64
limit_hint
;
...
...
src/Processors/QueryPlan/ExpressionStep.cpp
浏览文件 @
ca01094f
...
...
@@ -59,6 +59,21 @@ void ExpressionStep::transformPipeline(QueryPipeline & pipeline)
});
}
static
Strings
getActionsDescription
(
const
ExpressionActionsPtr
&
expression
)
{
Strings
res
;
for
(
const
auto
&
action
:
expression
->
getActions
())
res
.
emplace_back
((
res
.
empty
()
?
"Actions: "
:
" "
)
+
action
.
toString
());
return
res
;
}
Strings
ExpressionStep
::
describeActions
()
const
{
return
getActionsDescription
(
expression
);
}
InflatingExpressionStep
::
InflatingExpressionStep
(
const
DataStream
&
input_stream_
,
ExpressionActionsPtr
expression_
,
bool
default_totals_
)
:
ITransformingStep
(
input_stream_
,
...
...
@@ -88,4 +103,9 @@ void InflatingExpressionStep::transformPipeline(QueryPipeline & pipeline)
});
}
Strings
InflatingExpressionStep
::
describeActions
()
const
{
return
getActionsDescription
(
expression
);
}
}
src/Processors/QueryPlan/ExpressionStep.h
浏览文件 @
ca01094f
...
...
@@ -15,6 +15,8 @@ public:
void
transformPipeline
(
QueryPipeline
&
pipeline
)
override
;
Strings
describeActions
()
const
override
;
private:
ExpressionActionsPtr
expression
;
bool
default_totals
;
/// See ExpressionTransform
...
...
@@ -29,6 +31,8 @@ public:
void
transformPipeline
(
QueryPipeline
&
pipeline
)
override
;
Strings
describeActions
()
const
override
;
private:
ExpressionActionsPtr
expression
;
bool
default_totals
;
/// See ExpressionTransform
...
...
src/Processors/QueryPlan/FillingStep.cpp
浏览文件 @
ca01094f
...
...
@@ -27,4 +27,9 @@ void FillingStep::transformPipeline(QueryPipeline & pipeline)
});
}
Strings
FillingStep
::
describeActions
()
const
{
return
{
"Sort description: "
+
dumpSortDescription
(
sort_description
,
input_streams
.
front
().
header
)};
}
}
src/Processors/QueryPlan/FillingStep.h
浏览文件 @
ca01094f
...
...
@@ -14,6 +14,8 @@ public:
void
transformPipeline
(
QueryPipeline
&
pipeline
)
override
;
Strings
describeActions
()
const
override
;
private:
SortDescription
sort_description
;
};
...
...
src/Processors/QueryPlan/FilterStep.cpp
浏览文件 @
ca01094f
...
...
@@ -55,4 +55,16 @@ void FilterStep::transformPipeline(QueryPipeline & pipeline)
});
}
Strings
FilterStep
::
describeActions
()
const
{
Strings
res
;
res
.
emplace_back
(
"Filter column: "
+
filter_column_name
);
for
(
const
auto
&
action
:
expression
->
getActions
())
res
.
emplace_back
((
res
.
size
()
==
1
?
"Actions: "
:
" "
)
+
action
.
toString
());
return
res
;
}
}
src/Processors/QueryPlan/FilterStep.h
浏览文件 @
ca01094f
...
...
@@ -19,6 +19,8 @@ public:
String
getName
()
const
override
{
return
"Filter"
;
}
void
transformPipeline
(
QueryPipeline
&
pipeline
)
override
;
Strings
describeActions
()
const
override
;
private:
ExpressionActionsPtr
expression
;
String
filter_column_name
;
...
...
src/Processors/QueryPlan/FinishSortingStep.cpp
浏览文件 @
ca01094f
...
...
@@ -69,4 +69,17 @@ void FinishSortingStep::transformPipeline(QueryPipeline & pipeline)
}
}
Strings
FinishSortingStep
::
describeActions
()
const
{
Strings
res
=
{
"Prefix sort description: "
+
dumpSortDescription
(
prefix_description
,
input_streams
.
front
().
header
),
"Result sort description: "
+
dumpSortDescription
(
result_description
,
input_streams
.
front
().
header
)
};
if
(
limit
)
res
.
emplace_back
(
"Limit "
+
std
::
to_string
(
limit
));
return
res
;
}
}
src/Processors/QueryPlan/FinishSortingStep.h
浏览文件 @
ca01094f
...
...
@@ -19,6 +19,8 @@ public:
void
transformPipeline
(
QueryPipeline
&
pipeline
)
override
;
Strings
describeActions
()
const
override
;
private:
SortDescription
prefix_description
;
SortDescription
result_description
;
...
...
src/Processors/QueryPlan/LimitByStep.cpp
浏览文件 @
ca01094f
...
...
@@ -37,4 +37,23 @@ void LimitByStep::transformPipeline(QueryPipeline & pipeline)
});
}
Strings
LimitByStep
::
describeActions
()
const
{
Strings
res
;
String
columns_str
;
for
(
const
auto
&
column
:
columns
)
{
if
(
!
columns_str
.
empty
())
columns_str
+=
", "
;
columns_str
+=
column
;
}
return
{
"Columns: "
+
columns_str
,
"Length "
+
std
::
to_string
(
group_length
),
"Offset "
+
std
::
to_string
(
group_offset
),
};
}
}
src/Processors/QueryPlan/LimitByStep.h
浏览文件 @
ca01094f
...
...
@@ -15,6 +15,8 @@ public:
void
transformPipeline
(
QueryPipeline
&
pipeline
)
override
;
Strings
describeActions
()
const
override
;
private:
size_t
group_length
;
size_t
group_offset
;
...
...
src/Processors/QueryPlan/LimitStep.cpp
浏览文件 @
ca01094f
...
...
@@ -35,4 +35,30 @@ void LimitStep::transformPipeline(QueryPipeline & pipeline)
pipeline
.
addPipe
({
std
::
move
(
transform
)});
}
Strings
LimitStep
::
describeActions
()
const
{
Strings
res
;
res
.
emplace_back
(
"Limit "
+
std
::
to_string
(
limit
));
res
.
emplace_back
(
"Offset "
+
std
::
to_string
(
offset
));
if
(
with_ties
||
always_read_till_end
)
{
String
str
;
if
(
with_ties
)
str
+=
"WITH TIES"
;
if
(
always_read_till_end
)
{
if
(
!
str
.
empty
())
str
+=
", "
;
str
+=
"Reads all data"
;
}
res
.
emplace_back
(
str
);
}
return
res
;
}
}
src/Processors/QueryPlan/LimitStep.h
浏览文件 @
ca01094f
...
...
@@ -20,6 +20,8 @@ public:
void
transformPipeline
(
QueryPipeline
&
pipeline
)
override
;
Strings
describeActions
()
const
override
;
private:
size_t
limit
;
size_t
offset
;
...
...
src/Processors/QueryPlan/MergeSortingStep.cpp
浏览文件 @
ca01094f
...
...
@@ -48,4 +48,15 @@ void MergeSortingStep::transformPipeline(QueryPipeline & pipeline)
});
}
Strings
MergeSortingStep
::
describeActions
()
const
{
Strings
res
=
{
"Sort description: "
+
dumpSortDescription
(
description
,
input_streams
.
front
().
header
)};
if
(
limit
)
res
.
emplace_back
(
"Limit "
+
std
::
to_string
(
limit
));
return
res
;
}
}
src/Processors/QueryPlan/MergeSortingStep.h
浏览文件 @
ca01094f
...
...
@@ -24,6 +24,8 @@ public:
void
transformPipeline
(
QueryPipeline
&
pipeline
)
override
;
Strings
describeActions
()
const
override
;
private:
SortDescription
description
;
size_t
max_merged_block_size
;
...
...
src/Processors/QueryPlan/MergingAggregatedStep.cpp
浏览文件 @
ca01094f
...
...
@@ -63,4 +63,9 @@ void MergingAggregatedStep::transformPipeline(QueryPipeline & pipeline)
pipeline
.
enableQuotaForCurrentStreams
();
}
Strings
MergingAggregatedStep
::
describeActions
()
const
{
return
params
->
params
.
explain
();
}
}
src/Processors/QueryPlan/MergingAggregatedStep.h
浏览文件 @
ca01094f
...
...
@@ -22,6 +22,8 @@ public:
void
transformPipeline
(
QueryPipeline
&
pipeline
)
override
;
Strings
describeActions
()
const
override
;
private:
AggregatingTransformParamsPtr
params
;
bool
memory_efficient_aggregation
;
...
...
src/Processors/QueryPlan/MergingSortedStep.cpp
浏览文件 @
ca01094f
...
...
@@ -46,4 +46,14 @@ void MergingSortedStep::transformPipeline(QueryPipeline & pipeline)
}
}
Strings
MergingSortedStep
::
describeActions
()
const
{
Strings
res
=
{
"Sort description: "
+
dumpSortDescription
(
sort_description
,
input_streams
.
front
().
header
)};
if
(
limit
)
res
.
emplace_back
(
"Limit "
+
std
::
to_string
(
limit
));
return
res
;
}
}
src/Processors/QueryPlan/MergingSortedStep.h
浏览文件 @
ca01094f
...
...
@@ -20,6 +20,8 @@ public:
void
transformPipeline
(
QueryPipeline
&
pipeline
)
override
;
Strings
describeActions
()
const
override
;
private:
SortDescription
sort_description
;
size_t
max_block_size
;
...
...
src/Processors/QueryPlan/Offset
s
Step.cpp
→
src/Processors/QueryPlan/OffsetStep.cpp
浏览文件 @
ca01094f
#include <Processors/QueryPlan/Offset
s
Step.h>
#include <Processors/QueryPlan/OffsetStep.h>
#include <Processors/OffsetTransform.h>
#include <Processors/QueryPipeline.h>
...
...
@@ -13,13 +13,13 @@ static ITransformingStep::DataStreamTraits getTraits()
};
}
Offset
sStep
::
Offsets
Step
(
const
DataStream
&
input_stream_
,
size_t
offset_
)
Offset
Step
::
Offset
Step
(
const
DataStream
&
input_stream_
,
size_t
offset_
)
:
ITransformingStep
(
input_stream_
,
input_stream_
.
header
,
getTraits
())
,
offset
(
offset_
)
{
}
void
Offset
s
Step
::
transformPipeline
(
QueryPipeline
&
pipeline
)
void
OffsetStep
::
transformPipeline
(
QueryPipeline
&
pipeline
)
{
pipeline
.
addSimpleTransform
([
&
](
const
Block
&
header
,
QueryPipeline
::
StreamType
stream_type
)
->
ProcessorPtr
{
...
...
@@ -30,4 +30,9 @@ void OffsetsStep::transformPipeline(QueryPipeline & pipeline)
});
}
Strings
OffsetStep
::
describeActions
()
const
{
return
{
"Offset "
+
std
::
to_string
(
offset
)};
}
}
src/Processors/QueryPlan/Offset
s
Step.h
→
src/Processors/QueryPlan/OffsetStep.h
浏览文件 @
ca01094f
...
...
@@ -5,15 +5,17 @@
namespace
DB
{
class
Offset
s
Step
:
public
ITransformingStep
class
OffsetStep
:
public
ITransformingStep
{
public:
Offset
s
Step
(
const
DataStream
&
input_stream_
,
size_t
offset_
);
OffsetStep
(
const
DataStream
&
input_stream_
,
size_t
offset_
);
String
getName
()
const
override
{
return
"Offset
s
"
;
}
String
getName
()
const
override
{
return
"Offset"
;
}
void
transformPipeline
(
QueryPipeline
&
pipeline
)
override
;
Strings
describeActions
()
const
override
;
private:
size_t
offset
;
};
...
...
src/Processors/QueryPlan/PartialSortingStep.cpp
浏览文件 @
ca01094f
...
...
@@ -50,4 +50,14 @@ void PartialSortingStep::transformPipeline(QueryPipeline & pipeline)
});
}
Strings
PartialSortingStep
::
describeActions
()
const
{
Strings
res
=
{
"Sort description: "
+
dumpSortDescription
(
sort_description
,
input_streams
.
front
().
header
)};
if
(
limit
)
res
.
emplace_back
(
"Limit "
+
std
::
to_string
(
limit
));
return
res
;
}
}
src/Processors/QueryPlan/PartialSortingStep.h
浏览文件 @
ca01094f
...
...
@@ -19,6 +19,8 @@ public:
void
transformPipeline
(
QueryPipeline
&
pipeline
)
override
;
Strings
describeActions
()
const
override
;
private:
SortDescription
sort_description
;
UInt64
limit
;
...
...
src/Processors/QueryPlan/QueryPlan.cpp
浏览文件 @
ca01094f
...
...
@@ -207,7 +207,7 @@ static void explainStep(
for
(
const
auto
&
elem
:
step
.
getOutputStream
().
header
)
{
if
(
!
first
)
buffer
<<
"
,
\n
"
<<
prefix
<<
" "
;
buffer
<<
"
\n
"
<<
prefix
<<
" "
;
first
=
false
;
elem
.
dumpStructure
(
buffer
,
true
);
...
...
@@ -222,17 +222,8 @@ static void explainStep(
auto
actions
=
step
.
describeActions
();
if
(
!
actions
.
empty
())
{
buffer
<<
"Actions: "
;
bool
first
=
true
;
for
(
auto
&
action
:
actions
)
{
if
(
!
first
)
buffer
<<
",
\n
"
<<
prefix
<<
" "
;
first
=
false
;
buffer
<<
action
;
}
buffer
<<
prefix
<<
action
<<
'\n'
;
}
}
}
...
...
src/Processors/QueryPlan/TotalsHavingStep.cpp
浏览文件 @
ca01094f
...
...
@@ -2,6 +2,7 @@
#include <Processors/Transforms/DistinctTransform.h>
#include <Processors/QueryPipeline.h>
#include <Processors/Transforms/TotalsHavingTransform.h>
#include <Interpreters/ExpressionActions.h>
namespace
DB
{
...
...
@@ -44,4 +45,34 @@ void TotalsHavingStep::transformPipeline(QueryPipeline & pipeline)
pipeline
.
addTotalsHavingTransform
(
std
::
move
(
totals_having
));
}
static
String
totalsModeToString
(
TotalsMode
totals_mode
,
double
auto_include_threshold
)
{
switch
(
totals_mode
)
{
case
TotalsMode
::
BEFORE_HAVING
:
return
"before_having"
;
case
TotalsMode
::
AFTER_HAVING_INCLUSIVE
:
return
"after_having_inclusive"
;
case
TotalsMode
::
AFTER_HAVING_EXCLUSIVE
:
return
"after_having_exclusive"
;
case
TotalsMode
::
AFTER_HAVING_AUTO
:
return
"after_having_auto threshold "
+
std
::
to_string
(
auto_include_threshold
);
}
__builtin_unreachable
();
}
Strings
TotalsHavingStep
::
describeActions
()
const
{
Strings
res
;
res
.
emplace_back
(
"Filter column: "
+
filter_column_name
);
res
.
emplace_back
(
"Mode: "
+
totalsModeToString
(
totals_mode
,
auto_include_threshold
));
for
(
const
auto
&
action
:
expression
->
getActions
())
res
.
emplace_back
((
res
.
size
()
==
2
?
"Actions: "
:
" "
)
+
action
.
toString
());
return
res
;
}
}
src/Processors/QueryPlan/TotalsHavingStep.h
浏览文件 @
ca01094f
...
...
@@ -25,6 +25,8 @@ public:
void
transformPipeline
(
QueryPipeline
&
pipeline
)
override
;
Strings
describeActions
()
const
override
;
private:
bool
overflow_row
;
ExpressionActionsPtr
expression
;
...
...
src/Processors/Transforms/ConvertingTransform.h
浏览文件 @
ca01094f
...
...
@@ -35,6 +35,8 @@ public:
String
getName
()
const
override
{
return
"Converting"
;
}
const
ColumnNumbers
&
getConversion
()
const
{
return
conversion
;
}
protected:
void
transform
(
Chunk
&
chunk
)
override
;
...
...
src/Processors/ya.make
浏览文件 @
ca01094f
...
...
@@ -157,7 +157,7 @@ SRCS(
QueryPlan/MergeSortingStep.cpp
QueryPlan/MergingAggregatedStep.cpp
QueryPlan/MergingSortedStep.cpp
QueryPlan/Offset
s
Step.cpp
QueryPlan/OffsetStep.cpp
QueryPlan/PartialSortingStep.cpp
QueryPlan/UnionStep.cpp
QueryPlan/ReadFromPreparedSource.cpp
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录