Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
d3aa0e8e
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,发现更多精彩内容 >>
提交
d3aa0e8e
编写于
3月 09, 2020
作者:
A
Alexey Milovidov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clang-tidy, part 14
上级
7334c13d
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
45 addition
and
50 deletion
+45
-50
base/common/tests/gtest_json_test.cpp
base/common/tests/gtest_json_test.cpp
+1
-1
dbms/src/Common/tests/integer_hash_tables_and_hashes.cpp
dbms/src/Common/tests/integer_hash_tables_and_hashes.cpp
+2
-2
dbms/src/IO/tests/read_buffer_aio.cpp
dbms/src/IO/tests/read_buffer_aio.cpp
+20
-20
dbms/src/Storages/MergeTree/MergeTreeDataPartTTLInfo.cpp
dbms/src/Storages/MergeTree/MergeTreeDataPartTTLInfo.cpp
+6
-6
dbms/src/Storages/MergeTree/MergeTreeDataPartWriterWide.cpp
dbms/src/Storages/MergeTree/MergeTreeDataPartWriterWide.cpp
+4
-4
dbms/src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp
dbms/src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp
+11
-16
dbms/src/TableFunctions/TableFunctionGenerateRandom.cpp
dbms/src/TableFunctions/TableFunctionGenerateRandom.cpp
+1
-1
未找到文件。
base/common/tests/gtest_json_test.cpp
浏览文件 @
d3aa0e8e
...
...
@@ -22,7 +22,7 @@ struct GetStringTestRecord
std
::
string
result
;
};
TEST
(
JSON
_
Suite
,
SimpleTest
)
TEST
(
JSONSuite
,
SimpleTest
)
{
std
::
vector
<
GetStringTestRecord
>
test_data
=
{
...
...
dbms/src/Common/tests/integer_hash_tables_and_hashes.cpp
浏览文件 @
d3aa0e8e
...
...
@@ -272,9 +272,9 @@ namespace Hashes
};
size_t
res
=
0
;
for
(
size_t
i
=
0
;
i
<
8
;
++
i
)
for
(
auto
&
rand
:
random
)
{
res
^=
rand
om
[
i
]
[
UInt8
(
x
)];
res
^=
rand
[
UInt8
(
x
)];
x
>>=
8
;
}
...
...
dbms/src/IO/tests/read_buffer_aio.cpp
浏览文件 @
d3aa0e8e
...
...
@@ -68,26 +68,26 @@ void run()
const
std
::
vector
<
std
::
function
<
bool
()
>>
tests
=
{
std
::
bind
(
test1
,
std
::
ref
(
filename
))
,
std
::
bind
(
test2
,
std
::
ref
(
filename
),
std
::
ref
(
buf
))
,
std
::
bind
(
test3
,
std
::
ref
(
filename
),
std
::
ref
(
buf
))
,
std
::
bind
(
test4
,
std
::
ref
(
filename
),
std
::
ref
(
buf
))
,
std
::
bind
(
test5
,
std
::
ref
(
filename
),
std
::
ref
(
buf
))
,
std
::
bind
(
test6
,
std
::
ref
(
filename
),
std
::
ref
(
buf
))
,
std
::
bind
(
test7
,
std
::
ref
(
filename
),
std
::
ref
(
buf
))
,
std
::
bind
(
test8
,
std
::
ref
(
filename
),
std
::
ref
(
buf
))
,
std
::
bind
(
test9
,
std
::
ref
(
filename
),
std
::
ref
(
buf
))
,
std
::
bind
(
test10
,
std
::
ref
(
filename
),
std
::
ref
(
buf
))
,
std
::
bind
(
test11
,
std
::
ref
(
filename
))
,
std
::
bind
(
test12
,
std
::
ref
(
filename
),
std
::
ref
(
buf
))
,
std
::
bind
(
test13
,
std
::
ref
(
filename2
),
std
::
ref
(
buf2
))
,
std
::
bind
(
test14
,
std
::
ref
(
filename
),
std
::
ref
(
buf
))
,
std
::
bind
(
test15
,
std
::
ref
(
filename3
),
std
::
ref
(
buf3
))
,
std
::
bind
(
test16
,
std
::
ref
(
filename3
),
std
::
ref
(
buf3
))
,
std
::
bind
(
test17
,
std
::
ref
(
filename4
),
std
::
ref
(
buf4
))
,
std
::
bind
(
test18
,
std
::
ref
(
filename5
),
std
::
ref
(
buf5
))
,
std
::
bind
(
test19
,
std
::
ref
(
filename
),
std
::
ref
(
buf
))
,
std
::
bind
(
test20
,
std
::
ref
(
filename
),
std
::
ref
(
buf
))
[
&
]{
return
test1
(
filename
);
}
,
[
&
]{
return
test2
(
filename
,
buf
);
}
,
[
&
]{
return
test3
(
filename
,
buf
);
}
,
[
&
]{
return
test4
(
filename
,
buf
);
}
,
[
&
]{
return
test5
(
filename
,
buf
);
}
,
[
&
]{
return
test6
(
filename
,
buf
);
}
,
[
&
]{
return
test7
(
filename
,
buf
);
}
,
[
&
]{
return
test8
(
filename
,
buf
);
}
,
[
&
]{
return
test9
(
filename
,
buf
);
}
,
[
&
]{
return
test10
(
filename
,
buf
);
}
,
[
&
]{
return
test11
(
filename
);
}
,
[
&
]{
return
test12
(
filename
,
buf
);
}
,
[
&
]{
return
test13
(
filename2
,
buf2
);
}
,
[
&
]{
return
test14
(
filename
,
buf
);
}
,
[
&
]{
return
test15
(
filename3
,
buf3
);
}
,
[
&
]{
return
test16
(
filename3
,
buf3
);
}
,
[
&
]{
return
test17
(
filename4
,
buf4
);
}
,
[
&
]{
return
test18
(
filename5
,
buf5
);
}
,
[
&
]{
return
test19
(
filename
,
buf
);
}
,
[
&
]{
return
test20
(
filename
,
buf
);
}
};
unsigned
int
num
=
0
;
...
...
dbms/src/Storages/MergeTree/MergeTreeDataPartTTLInfo.cpp
浏览文件 @
d3aa0e8e
...
...
@@ -96,9 +96,9 @@ void MergeTreeDataPartTTLInfos::write(WriteBuffer & out) const
{
if
(
!
columns_ttl
.
empty
())
writeString
(
","
,
out
);
writeString
(
"
\"
table
\"
:{
\"
min
\"
:
"
,
out
);
writeString
(
R"("table":{"min":)
"
,
out
);
writeIntText
(
table_ttl
.
min
,
out
);
writeString
(
",
\"
max
\"
:
"
,
out
);
writeString
(
R"(,"max":)
"
,
out
);
writeIntText
(
table_ttl
.
max
,
out
);
writeString
(
"}"
,
out
);
}
...
...
@@ -106,17 +106,17 @@ void MergeTreeDataPartTTLInfos::write(WriteBuffer & out) const
{
if
(
!
columns_ttl
.
empty
()
||
table_ttl
.
min
)
writeString
(
","
,
out
);
writeString
(
"
\"
moves
\"
:[
"
,
out
);
writeString
(
R"("moves":[)
"
,
out
);
for
(
auto
it
=
moves_ttl
.
begin
();
it
!=
moves_ttl
.
end
();
++
it
)
{
if
(
it
!=
moves_ttl
.
begin
())
writeString
(
","
,
out
);
writeString
(
"{
\"
expression
\"
:
"
,
out
);
writeString
(
R"({"expression":)
"
,
out
);
writeString
(
doubleQuoteString
(
it
->
first
),
out
);
writeString
(
",
\"
min
\"
:
"
,
out
);
writeString
(
R"(,"min":)
"
,
out
);
writeIntText
(
it
->
second
.
min
,
out
);
writeString
(
",
\"
max
\"
:
"
,
out
);
writeString
(
R"(,"max":)
"
,
out
);
writeIntText
(
it
->
second
.
max
,
out
);
writeString
(
"}"
,
out
);
}
...
...
dbms/src/Storages/MergeTree/MergeTreeDataPartWriterWide.cpp
浏览文件 @
d3aa0e8e
...
...
@@ -295,12 +295,12 @@ void MergeTreeDataPartWriterWide::finishDataSerialization(IMergeTreeDataPart::Ch
}
}
for
(
auto
it
=
column_streams
.
begin
();
it
!=
column_streams
.
end
();
++
it
)
for
(
auto
&
stream
:
column_streams
)
{
it
->
second
->
finalize
();
stream
.
second
->
finalize
();
if
(
sync
)
it
->
second
->
sync
();
it
->
second
->
addToChecksums
(
checksums
);
stream
.
second
->
sync
();
stream
.
second
->
addToChecksums
(
checksums
);
}
column_streams
.
clear
();
...
...
dbms/src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp
浏览文件 @
d3aa0e8e
...
...
@@ -109,18 +109,17 @@ size_t MergeTreeDataSelectExecutor::getApproximateTotalRowsToRead(
/// We will find out how many rows we would have read without sampling.
LOG_DEBUG
(
log
,
"Preliminary index scan with condition: "
<<
key_condition
.
toString
());
for
(
size_t
i
=
0
;
i
<
parts
.
size
();
++
i
)
for
(
const
auto
&
part
:
parts
)
{
const
MergeTreeData
::
DataPartPtr
&
part
=
parts
[
i
];
MarkRanges
ranges
=
markRangesFromPKRange
(
part
,
key_condition
,
settings
);
/** In order to get a lower bound on the number of rows that match the condition on PK,
* consider only guaranteed full marks.
* That is, do not take into account the first and last marks, which may be incomplete.
*/
for
(
size_t
j
=
0
;
j
<
ranges
.
size
();
++
j
)
if
(
range
s
[
j
].
end
-
ranges
[
j
]
.
begin
>
2
)
rows_count
+=
part
->
index_granularity
.
getRowsCountInRange
({
range
s
[
j
].
begin
+
1
,
ranges
[
j
]
.
end
-
1
});
for
(
const
auto
&
range
:
ranges
)
if
(
range
.
end
-
range
.
begin
>
2
)
rows_count
+=
part
->
index_granularity
.
getRowsCountInRange
({
range
.
begin
+
1
,
range
.
end
-
1
});
}
...
...
@@ -794,10 +793,8 @@ Pipes MergeTreeDataSelectExecutor::spreadMarkRangesAmongStreams(
{
/// Sequential query execution.
for
(
size_t
part_index
=
0
;
part_index
<
parts
.
size
();
++
part_index
)
for
(
const
auto
&
part
:
parts
)
{
RangesInDataPart
&
part
=
parts
[
part_index
];
auto
source
=
std
::
make_shared
<
MergeTreeSelectProcessor
>
(
data
,
part
.
data_part
,
max_block_size
,
settings
.
preferred_block_size_bytes
,
settings
.
preferred_max_column_in_block_size_bytes
,
column_names
,
part
.
ranges
,
use_uncompressed_cache
,
...
...
@@ -1025,13 +1022,13 @@ Pipes MergeTreeDataSelectExecutor::spreadMarkRangesAmongStreamsFinal(
const
auto
data_settings
=
data
.
getSettings
();
size_t
sum_marks
=
0
;
size_t
adaptive_parts
=
0
;
for
(
size_t
i
=
0
;
i
<
parts
.
size
();
++
i
)
for
(
const
auto
&
part
:
parts
)
{
for
(
size_t
j
=
0
;
j
<
parts
[
i
].
ranges
.
size
();
++
j
)
sum_marks
+=
parts
[
i
].
ranges
[
j
].
end
-
parts
[
i
].
ranges
[
j
]
.
begin
;
for
(
const
auto
&
range
:
part
.
ranges
)
sum_marks
+=
range
.
end
-
range
.
begin
;
if
(
part
s
[
i
]
.
data_part
->
index_granularity_info
.
is_adaptive
)
adaptive_parts
++
;
if
(
part
.
data_part
->
index_granularity_info
.
is_adaptive
)
++
adaptive_parts
;
}
size_t
index_granularity_bytes
=
0
;
...
...
@@ -1049,10 +1046,8 @@ Pipes MergeTreeDataSelectExecutor::spreadMarkRangesAmongStreamsFinal(
Pipes
pipes
;
for
(
size_t
part_index
=
0
;
part_index
<
parts
.
size
();
++
part_index
)
for
(
const
auto
&
part
:
parts
)
{
RangesInDataPart
&
part
=
parts
[
part_index
];
auto
source_processor
=
std
::
make_shared
<
MergeTreeSelectProcessor
>
(
data
,
part
.
data_part
,
max_block_size
,
settings
.
preferred_block_size_bytes
,
settings
.
preferred_max_column_in_block_size_bytes
,
column_names
,
part
.
ranges
,
use_uncompressed_cache
,
...
...
dbms/src/TableFunctions/TableFunctionGenerateRandom.cpp
浏览文件 @
d3aa0e8e
...
...
@@ -34,7 +34,7 @@ StoragePtr TableFunctionGenerateRandom::executeImpl(const ASTPtr & ast_function,
ASTs
&
args
=
args_func
.
at
(
0
)
->
children
;
if
(
args
.
size
()
<
1
)
if
(
args
.
empty
()
)
throw
Exception
(
"Table function '"
+
getName
()
+
"' requires at least one argument: "
" structure, [random_seed, max_string_length, max_array_length]."
,
ErrorCodes
::
NUMBER_OF_ARGUMENTS_DOESNT_MATCH
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录