Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
a7957914
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,发现更多精彩内容 >>
提交
a7957914
编写于
6月 07, 2019
作者:
I
Ivan Lezhankin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Check for orphaned databases too
上级
398e1edd
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
90 addition
and
84 deletion
+90
-84
dbms/tests/queries/0_stateless/00028_shard_big_agg_aj_distributed.reference
.../0_stateless/00028_shard_big_agg_aj_distributed.reference
+1
-0
dbms/tests/queries/0_stateless/00028_shard_big_agg_aj_distributed.sql
...ueries/0_stateless/00028_shard_big_agg_aj_distributed.sql
+6
-5
dbms/tests/queries/0_stateless/00028_shard_big_non_agg_aj_distributed.reference
...tateless/00028_shard_big_non_agg_aj_distributed.reference
+0
-1
dbms/tests/queries/0_stateless/00028_shard_big_non_agg_aj_distributed.sql
...es/0_stateless/00028_shard_big_non_agg_aj_distributed.sql
+0
-2
dbms/tests/queries/0_stateless/00252_shard_global_in_aggregate_function.sql
.../0_stateless/00252_shard_global_in_aggregate_function.sql
+7
-5
dbms/tests/queries/0_stateless/00515_shard_desc_table_functions_and_subqueries.sql
...eless/00515_shard_desc_table_functions_and_subqueries.sql
+7
-7
dbms/tests/queries/0_stateless/00625_summing_merge_tree_merge.sql
...ts/queries/0_stateless/00625_summing_merge_tree_merge.sql
+15
-13
dbms/tests/queries/0_stateless/00926_adaptive_index_granularity_versioned_collapsing_merge_tree.sql
...ive_index_granularity_versioned_collapsing_merge_tree.sql
+41
-41
dbms/tests/queries/0_stateless/00930_max_partitions_per_insert_block.sql
...ies/0_stateless/00930_max_partitions_per_insert_block.sql
+9
-9
dbms/tests/queries/query_test.py
dbms/tests/queries/query_test.py
+4
-1
未找到文件。
dbms/tests/queries/0_stateless/00028_shard_big_agg_aj_distributed.reference
浏览文件 @
a7957914
253984050
253984050
dbms/tests/queries/0_stateless/00028_shard_big_agg_aj_distributed.sql
浏览文件 @
a7957914
CREATE
DATABASE
IF
NOT
EXISTS
test
;
DROP
TABLE
IF
EXISTS
test
.
big_array
;
CREATE
TABLE
test
.
big_array
(
x
Array
(
UInt8
))
ENGINE
=
TinyLog
;
DROP
TABLE
IF
EXISTS
big_array
;
CREATE
TABLE
big_array
(
x
Array
(
UInt8
))
ENGINE
=
TinyLog
;
SET
min_insert_block_size_rows
=
0
,
min_insert_block_size_bytes
=
0
;
INSERT
INTO
test
.
big_array
SELECT
groupArray
(
number
%
255
)
AS
x
FROM
(
SELECT
*
FROM
system
.
numbers
LIMIT
1000000
);
SELECT
sum
(
y
)
AS
s
FROM
remote
(
'127.0.0.{2,3}'
,
test
,
big_array
)
ARRAY
JOIN
x
AS
y
;
INSERT
INTO
big_array
SELECT
groupArray
(
number
%
255
)
AS
x
FROM
(
SELECT
*
FROM
system
.
numbers
LIMIT
1000000
);
SELECT
sum
(
y
)
AS
s
FROM
remote
(
'127.0.0.{2,3}'
,
currentDatabase
(),
big_array
)
ARRAY
JOIN
x
AS
y
;
SELECT
sum
(
s
)
FROM
(
SELECT
y
AS
s
FROM
remote
(
'127.0.0.{2,3}'
,
currentDatabase
(),
big_array
)
ARRAY
JOIN
x
AS
y
);
DROP
TABLE
big_array
;
dbms/tests/queries/0_stateless/00028_shard_big_non_agg_aj_distributed.reference
已删除
100644 → 0
浏览文件 @
398e1edd
253984050
dbms/tests/queries/0_stateless/00028_shard_big_non_agg_aj_distributed.sql
已删除
100644 → 0
浏览文件 @
398e1edd
SELECT
sum
(
s
)
FROM
(
SELECT
y
AS
s
FROM
remote
(
'127.0.0.{2,3}'
,
test
,
big_array
)
ARRAY
JOIN
x
AS
y
);
DROP
TABLE
test
.
big_array
;
dbms/tests/queries/0_stateless/00252_shard_global_in_aggregate_function.sql
浏览文件 @
a7957914
DROP
TABLE
IF
EXISTS
test
.
storage
;
CREATE
TABLE
test
.
storage
(
UserID
UInt64
)
ENGINE
=
Memory
;
INSERT
INTO
test
.
storage
(
UserID
)
values
(
6460432721393873721
)(
6460432721393873721
)(
6460432721393873721
)(
6460432721393873721
)(
6460432721393873721
)(
6460432721393873721
)(
6460432721393873721
)(
402895971392036118
)(
402895971392036118
)(
402895971392036118
);
DROP
TABLE
IF
EXISTS
storage
;
CREATE
TABLE
storage
(
UserID
UInt64
)
ENGINE
=
Memory
;
INSERT
INTO
storage
(
UserID
)
values
(
6460432721393873721
)(
6460432721393873721
)(
6460432721393873721
)(
6460432721393873721
)(
6460432721393873721
)(
6460432721393873721
)(
6460432721393873721
)(
402895971392036118
)(
402895971392036118
)(
402895971392036118
);
SELECT
sum
(
UserID
GLOBAL
IN
(
SELECT
UserID
FROM
remote
(
'127.0.0.{2,3}'
,
test
.
storage
)))
FROM
remote
(
'127.0.0.{2,3}'
,
test
.
storage
);
SELECT
sum
(
UserID
GLOBAL
IN
(
SELECT
UserID
FROM
test
.
storage
))
FROM
remote
(
'127.0.0.{2,3}'
,
test
.
storage
);
SELECT
sum
(
UserID
GLOBAL
IN
(
SELECT
UserID
FROM
remote
(
'127.0.0.{2,3}'
,
currentDatabase
(),
storage
)))
FROM
remote
(
'127.0.0.{2,3}'
,
currentDatabase
(),
storage
);
SELECT
sum
(
UserID
GLOBAL
IN
(
SELECT
UserID
FROM
storage
))
FROM
remote
(
'127.0.0.{2,3}'
,
currentDatabase
(),
storage
);
DROP
TABLE
storage
;
dbms/tests/queries/0_stateless/00515_shard_desc_table_functions_and_subqueries.sql
浏览文件 @
a7957914
drop
table
if
exists
t
est
.
t
ab
;
create
table
t
est
.
t
ab
(
date
Date
,
val
UInt64
,
val2
UInt8
default
42
,
val3
UInt8
default
val2
+
1
,
val4
UInt64
alias
val
)
engine
=
MergeTree
(
date
,
(
date
,
val
),
8192
);
desc
t
est
.
t
ab
;
drop
table
if
exists
tab
;
create
table
tab
(
date
Date
,
val
UInt64
,
val2
UInt8
default
42
,
val3
UInt8
default
val2
+
1
,
val4
UInt64
alias
val
)
engine
=
MergeTree
(
date
,
(
date
,
val
),
8192
);
desc
tab
;
select
'-'
;
desc
table
t
est
.
t
ab
;
desc
table
tab
;
select
'-'
;
desc
remote
(
'127.0.0.2'
,
test
.
tab
);
desc
remote
(
'127.0.0.2'
,
currentDatabase
(),
tab
);
select
'-'
;
desc
table
remote
(
'127.0.0.2'
,
test
.
tab
);
desc
table
remote
(
'127.0.0.2'
,
currentDatabase
(),
tab
);
select
'-'
;
desc
(
select
1
);
select
'-'
;
...
...
@@ -14,4 +14,4 @@ desc table (select 1);
select
'-'
;
desc
(
select
*
from
system
.
numbers
);
select
'-'
;
drop
table
if
exists
t
est
.
t
ab
;
drop
table
if
exists
tab
;
dbms/tests/queries/0_stateless/00625_summing_merge_tree_merge.sql
浏览文件 @
a7957914
...
...
@@ -2,28 +2,30 @@ DROP TABLE IF EXISTS tab_00625;
CREATE
TABLE
tab_00625
(
date
Date
,
key
UInt32
,
date
Date
,
key
UInt32
,
testMap
Nested
(
k
UInt16
,
k
UInt16
,
v
UInt64
)
)
ENGINE
=
SummingMergeTree
(
date
,
(
date
,
key
),
1
);
INSERT
INTO
tab_00625
SELECT
today
(),
number
,
[
toUInt16
(
number
)],
INSERT
INTO
tab_00625
SELECT
today
(),
number
,
[
toUInt16
(
number
)],
[
number
]
FROM
system
.
numbers
FROM
system
.
numbers
LIMIT
8190
;
INSERT
INTO
tab_00625
SELECT
today
(),
number
+
8190
,
[
toUInt16
(
number
)],
INSERT
INTO
tab_00625
SELECT
today
(),
number
+
8190
,
[
toUInt16
(
number
)],
[
number
+
8190
]
FROM
system
.
numbers
FROM
system
.
numbers
LIMIT
10
;
OPTIMIZE
TABLE
tab_00625
;
DROP
TABLE
tab_00625
;
dbms/tests/queries/0_stateless/00926_adaptive_index_granularity_versioned_collapsing_merge_tree.sql
浏览文件 @
a7957914
----- Group of very similar simple tests ------
DROP
TABLE
IF
EXISTS
test
.
zero_rows_per_granule
;
DROP
TABLE
IF
EXISTS
zero_rows_per_granule
;
CREATE
TABLE
test
.
zero_rows_per_granule
(
CREATE
TABLE
zero_rows_per_granule
(
p
Date
,
k
UInt64
,
v1
UInt64
,
...
...
@@ -14,26 +14,26 @@ CREATE TABLE test.zero_rows_per_granule (
vertical_merge_algorithm_min_rows_to_activate
=
0
,
vertical_merge_algorithm_min_columns_to_activate
=
0
;
INSERT
INTO
test
.
zero_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
1
,
1000
,
2000
,
1
,
1
),
(
'2018-05-16'
,
2
,
3000
,
4000
,
1
,
1
),
(
'2018-05-17'
,
3
,
5000
,
6000
,
1
,
1
),
(
'2018-05-18'
,
4
,
7000
,
8000
,
1
,
1
);
INSERT
INTO
zero_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
1
,
1000
,
2000
,
1
,
1
),
(
'2018-05-16'
,
2
,
3000
,
4000
,
1
,
1
),
(
'2018-05-17'
,
3
,
5000
,
6000
,
1
,
1
),
(
'2018-05-18'
,
4
,
7000
,
8000
,
1
,
1
);
SELECT
COUNT
(
*
)
FROM
test
.
zero_rows_per_granule
;
SELECT
COUNT
(
*
)
FROM
zero_rows_per_granule
;
SELECT
distinct
(
marks
)
from
system
.
parts
WHERE
table
=
'zero_rows_per_granule'
and
database
=
'test'
and
active
=
1
;
SELECT
distinct
(
marks
)
from
system
.
parts
WHERE
table
=
'zero_rows_per_granule'
and
database
=
currentDatabase
()
and
active
=
1
;
INSERT
INTO
test
.
zero_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
5
,
1000
,
2000
,
1
,
1
),
(
'2018-05-16'
,
6
,
3000
,
4000
,
1
,
1
),
(
'2018-05-17'
,
7
,
5000
,
6000
,
1
,
1
),
(
'2018-05-19'
,
8
,
7000
,
8000
,
1
,
1
);
INSERT
INTO
zero_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
5
,
1000
,
2000
,
1
,
1
),
(
'2018-05-16'
,
6
,
3000
,
4000
,
1
,
1
),
(
'2018-05-17'
,
7
,
5000
,
6000
,
1
,
1
),
(
'2018-05-19'
,
8
,
7000
,
8000
,
1
,
1
);
OPTIMIZE
TABLE
test
.
zero_rows_per_granule
FINAL
;
OPTIMIZE
TABLE
zero_rows_per_granule
FINAL
;
SELECT
COUNT
(
*
)
FROM
test
.
zero_rows_per_granule
FINAL
;
SELECT
COUNT
(
*
)
FROM
zero_rows_per_granule
FINAL
;
SELECT
sum
(
marks
)
from
system
.
parts
WHERE
table
=
'zero_rows_per_granule'
and
database
=
'test'
and
active
=
1
;
SELECT
sum
(
marks
)
from
system
.
parts
WHERE
table
=
'zero_rows_per_granule'
and
database
=
currentDatabase
()
and
active
=
1
;
DROP
TABLE
IF
EXISTS
test
.
zero_rows_per_granule
;
DROP
TABLE
IF
EXISTS
zero_rows_per_granule
;
SELECT
'-----'
;
DROP
TABLE
IF
EXISTS
test
.
four_rows_per_granule
;
DROP
TABLE
IF
EXISTS
four_rows_per_granule
;
CREATE
TABLE
test
.
four_rows_per_granule
(
CREATE
TABLE
four_rows_per_granule
(
p
Date
,
k
UInt64
,
v1
UInt64
,
...
...
@@ -46,39 +46,39 @@ CREATE TABLE test.four_rows_per_granule (
vertical_merge_algorithm_min_rows_to_activate
=
0
,
vertical_merge_algorithm_min_columns_to_activate
=
0
;
INSERT
INTO
test
.
four_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
1
,
1000
,
2000
,
1
,
1
),
(
'2018-05-16'
,
2
,
3000
,
4000
,
1
,
1
),
(
'2018-05-17'
,
3
,
5000
,
6000
,
1
,
1
),
(
'2018-05-18'
,
4
,
7000
,
8000
,
1
,
1
);
INSERT
INTO
four_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
1
,
1000
,
2000
,
1
,
1
),
(
'2018-05-16'
,
2
,
3000
,
4000
,
1
,
1
),
(
'2018-05-17'
,
3
,
5000
,
6000
,
1
,
1
),
(
'2018-05-18'
,
4
,
7000
,
8000
,
1
,
1
);
SELECT
COUNT
(
*
)
FROM
test
.
four_rows_per_granule
;
SELECT
COUNT
(
*
)
FROM
four_rows_per_granule
;
SELECT
distinct
(
marks
)
from
system
.
parts
WHERE
table
=
'four_rows_per_granule'
and
database
=
'test'
and
active
=
1
;
SELECT
distinct
(
marks
)
from
system
.
parts
WHERE
table
=
'four_rows_per_granule'
and
database
=
currentDatabase
()
and
active
=
1
;
INSERT
INTO
test
.
four_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
1
,
1000
,
2000
,
-
1
,
1
),
(
'2018-05-16'
,
2
,
3000
,
4000
,
-
1
,
1
),
(
'2018-05-17'
,
3
,
5000
,
6000
,
-
1
,
1
),
(
'2018-05-18'
,
4
,
7000
,
8000
,
-
1
,
1
);
INSERT
INTO
four_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
1
,
1000
,
2000
,
-
1
,
1
),
(
'2018-05-16'
,
2
,
3000
,
4000
,
-
1
,
1
),
(
'2018-05-17'
,
3
,
5000
,
6000
,
-
1
,
1
),
(
'2018-05-18'
,
4
,
7000
,
8000
,
-
1
,
1
);
OPTIMIZE
TABLE
test
.
four_rows_per_granule
FINAL
;
OPTIMIZE
TABLE
four_rows_per_granule
FINAL
;
SELECT
COUNT
(
*
)
FROM
test
.
four_rows_per_granule
;
SELECT
COUNT
(
*
)
FROM
four_rows_per_granule
;
SELECT
distinct
(
marks
)
from
system
.
parts
WHERE
table
=
'four_rows_per_granule'
and
database
=
'test'
and
active
=
1
;
SELECT
distinct
(
marks
)
from
system
.
parts
WHERE
table
=
'four_rows_per_granule'
and
database
=
currentDatabase
()
and
active
=
1
;
INSERT
INTO
test
.
four_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
1
,
1000
,
2000
,
1
,
1
),
(
'2018-05-16'
,
2
,
3000
,
4000
,
1
,
1
),
(
'2018-05-17'
,
3
,
5000
,
6000
,
1
,
1
),
(
'2018-05-18'
,
4
,
7000
,
8000
,
1
,
1
);
INSERT
INTO
four_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
1
,
1000
,
2000
,
1
,
1
),
(
'2018-05-16'
,
2
,
3000
,
4000
,
1
,
1
),
(
'2018-05-17'
,
3
,
5000
,
6000
,
1
,
1
),
(
'2018-05-18'
,
4
,
7000
,
8000
,
1
,
1
);
INSERT
INTO
test
.
four_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
5
,
1000
,
2000
,
1
,
1
),
(
'2018-05-16'
,
6
,
3000
,
4000
,
1
,
1
),
(
'2018-05-17'
,
7
,
5000
,
6000
,
1
,
1
),
(
'2018-05-18'
,
8
,
7000
,
8000
,
1
,
1
);
INSERT
INTO
four_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
5
,
1000
,
2000
,
1
,
1
),
(
'2018-05-16'
,
6
,
3000
,
4000
,
1
,
1
),
(
'2018-05-17'
,
7
,
5000
,
6000
,
1
,
1
),
(
'2018-05-18'
,
8
,
7000
,
8000
,
1
,
1
);
INSERT
INTO
test
.
four_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
5
,
1000
,
2000
,
-
1
,
1
),
(
'2018-05-17'
,
7
,
5000
,
6000
,
-
1
,
1
);
INSERT
INTO
four_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
5
,
1000
,
2000
,
-
1
,
1
),
(
'2018-05-17'
,
7
,
5000
,
6000
,
-
1
,
1
);
OPTIMIZE
TABLE
test
.
four_rows_per_granule
FINAL
;
OPTIMIZE
TABLE
four_rows_per_granule
FINAL
;
SELECT
COUNT
(
*
)
FROM
test
.
four_rows_per_granule
;
SELECT
COUNT
(
*
)
FROM
four_rows_per_granule
;
SELECT
distinct
(
marks
)
from
system
.
parts
WHERE
table
=
'four_rows_per_granule'
and
database
=
'test'
and
active
=
1
;
SELECT
distinct
(
marks
)
from
system
.
parts
WHERE
table
=
'four_rows_per_granule'
and
database
=
currentDatabase
()
and
active
=
1
;
DROP
TABLE
IF
EXISTS
test
.
four_rows_per_granule
;
DROP
TABLE
IF
EXISTS
four_rows_per_granule
;
SELECT
'-----'
;
DROP
TABLE
IF
EXISTS
test
.
six_rows_per_granule
;
DROP
TABLE
IF
EXISTS
six_rows_per_granule
;
CREATE
TABLE
test
.
six_rows_per_granule
(
CREATE
TABLE
six_rows_per_granule
(
p
Date
,
k
UInt64
,
v1
UInt64
,
...
...
@@ -92,28 +92,28 @@ CREATE TABLE test.six_rows_per_granule (
vertical_merge_algorithm_min_columns_to_activate
=
0
;
INSERT
INTO
test
.
six_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
1
,
1000
,
2000
,
1
,
1
),
(
'2018-05-16'
,
1
,
1000
,
2000
,
-
1
,
2
);
INSERT
INTO
six_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
1
,
1000
,
2000
,
1
,
1
),
(
'2018-05-16'
,
1
,
1000
,
2000
,
-
1
,
2
);
INSERT
INTO
test
.
six_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
2
,
1000
,
2000
,
1
,
1
),
(
'2018-05-16'
,
2
,
1000
,
2000
,
-
1
,
2
);
INSERT
INTO
six_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
2
,
1000
,
2000
,
1
,
1
),
(
'2018-05-16'
,
2
,
1000
,
2000
,
-
1
,
2
);
INSERT
INTO
test
.
six_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
3
,
1000
,
2000
,
1
,
1
),
(
'2018-05-16'
,
3
,
1000
,
2000
,
-
1
,
2
);
INSERT
INTO
six_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
3
,
1000
,
2000
,
1
,
1
),
(
'2018-05-16'
,
3
,
1000
,
2000
,
-
1
,
2
);
OPTIMIZE
TABLE
test
.
six_rows_per_granule
FINAL
;
OPTIMIZE
TABLE
six_rows_per_granule
FINAL
;
SELECT
COUNT
(
*
)
FROM
test
.
six_rows_per_granule
;
SELECT
COUNT
(
*
)
FROM
six_rows_per_granule
;
SELECT
distinct
(
marks
)
from
system
.
parts
WHERE
table
=
'six_rows_per_granule'
and
database
=
'test'
and
active
=
1
;
SELECT
distinct
(
marks
)
from
system
.
parts
WHERE
table
=
'six_rows_per_granule'
and
database
=
currentDatabase
()
and
active
=
1
;
INSERT
INTO
test
.
six_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
1
,
1000
,
2000
,
-
1
,
1
),
(
'2018-05-16'
,
1
,
1000
,
2000
,
1
,
2
);
INSERT
INTO
six_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
1
,
1000
,
2000
,
-
1
,
1
),
(
'2018-05-16'
,
1
,
1000
,
2000
,
1
,
2
);
INSERT
INTO
test
.
six_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
2
,
1000
,
2000
,
-
1
,
1
),
(
'2018-05-16'
,
2
,
1000
,
2000
,
1
,
2
);
INSERT
INTO
six_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
2
,
1000
,
2000
,
-
1
,
1
),
(
'2018-05-16'
,
2
,
1000
,
2000
,
1
,
2
);
INSERT
INTO
test
.
six_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
3
,
1000
,
2000
,
-
1
,
1
),
(
'2018-05-16'
,
3
,
1000
,
2000
,
1
,
2
);
INSERT
INTO
six_rows_per_granule
(
p
,
k
,
v1
,
v2
,
Sign
,
Version
)
VALUES
(
'2018-05-15'
,
3
,
1000
,
2000
,
-
1
,
1
),
(
'2018-05-16'
,
3
,
1000
,
2000
,
1
,
2
);
OPTIMIZE
TABLE
test
.
six_rows_per_granule
FINAL
;
OPTIMIZE
TABLE
six_rows_per_granule
FINAL
;
SELECT
COUNT
(
*
)
FROM
test
.
six_rows_per_granule
;
SELECT
COUNT
(
*
)
FROM
six_rows_per_granule
;
SELECT
distinct
(
marks
)
from
system
.
parts
WHERE
table
=
'six_rows_per_granule'
and
database
=
'test'
and
active
=
1
;
SELECT
distinct
(
marks
)
from
system
.
parts
WHERE
table
=
'six_rows_per_granule'
and
database
=
currentDatabase
()
and
active
=
1
;
DROP
TABLE
IF
EXISTS
test
.
six_rows_per_granule
;
DROP
TABLE
IF
EXISTS
six_rows_per_granule
;
dbms/tests/queries/0_stateless/00930_max_partitions_per_insert_block.sql
浏览文件 @
a7957914
DROP
TABLE
IF
EXISTS
test
.
partitions
;
CREATE
TABLE
test
.
partitions
(
x
UInt64
)
ENGINE
=
MergeTree
ORDER
BY
x
PARTITION
BY
x
;
DROP
TABLE
IF
EXISTS
partitions
;
CREATE
TABLE
partitions
(
x
UInt64
)
ENGINE
=
MergeTree
ORDER
BY
x
PARTITION
BY
x
;
INSERT
INTO
test
.
partitions
SELECT
*
FROM
system
.
numbers
LIMIT
100
;
SELECT
count
()
FROM
system
.
parts
WHERE
database
=
'test'
AND
table
=
'partitions'
;
INSERT
INTO
test
.
partitions
SELECT
*
FROM
system
.
numbers
LIMIT
100
;
SELECT
count
()
FROM
system
.
parts
WHERE
database
=
'test'
AND
table
=
'partitions'
;
INSERT
INTO
partitions
SELECT
*
FROM
system
.
numbers
LIMIT
100
;
SELECT
count
()
FROM
system
.
parts
WHERE
database
=
currentDatabase
()
AND
table
=
'partitions'
;
INSERT
INTO
partitions
SELECT
*
FROM
system
.
numbers
LIMIT
100
;
SELECT
count
()
FROM
system
.
parts
WHERE
database
=
currentDatabase
()
AND
table
=
'partitions'
;
SET
max_partitions_per_insert_block
=
1
;
INSERT
INTO
test
.
partitions
SELECT
*
FROM
system
.
numbers
LIMIT
1
;
INSERT
INTO
test
.
partitions
SELECT
*
FROM
system
.
numbers
LIMIT
2
;
-- { serverError 252 }
INSERT
INTO
partitions
SELECT
*
FROM
system
.
numbers
LIMIT
1
;
INSERT
INTO
partitions
SELECT
*
FROM
system
.
numbers
LIMIT
2
;
-- { serverError 252 }
DROP
TABLE
test
.
partitions
;
DROP
TABLE
partitions
;
dbms/tests/queries/query_test.py
浏览文件 @
a7957914
...
...
@@ -51,7 +51,10 @@ def test_query(bin_prefix, sql_query, standalone_server):
query
=
'CREATE DATABASE {random}; USE {random}; {query}'
.
format
(
random
=
random_name
,
query
=
query
)
run_client
(
bin_prefix
,
tcp_port
,
query
,
reference
,
{
random_name
:
'default'
})
query
=
"SELECT 'SHOW ORPHANED TABLES'; SELECT
database,
name FROM system.tables WHERE database != 'system' ORDER BY (database, name);"
query
=
"SELECT 'SHOW ORPHANED TABLES'; SELECT name FROM system.tables WHERE database != 'system' ORDER BY (database, name);"
run_client
(
bin_prefix
,
tcp_port
,
query
,
'SHOW ORPHANED TABLES
\n
'
)
run_client
(
bin_prefix
,
tcp_port
,
'DROP DATABASE {random};'
.
format
(
random
=
random_name
),
''
)
query
=
"SELECT 'SHOW ORPHANED DATABASES'; SHOW DATABASES;"
run_client
(
bin_prefix
,
tcp_port
,
query
,
'SHOW ORPHANED DATABASES
\n
default
\n
system
\n
'
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录