-
Notifications
You must be signed in to change notification settings - Fork 762
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
17 deletions.
There are no files selected for viewing
32 changes: 15 additions & 17 deletions
32
tests/sqllogictests/suites/mode/cluster/distributed_compact.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,48 @@ | ||
statement ok | ||
drop table if exists t | ||
drop table if exists t_compact | ||
|
||
statement ok | ||
create table t (a int not null) row_per_block=5 block_per_segment=5 | ||
create table t_compact (a int not null) row_per_block=5 block_per_segment=5 | ||
|
||
statement ok | ||
insert into t select 50 - number from numbers(100) | ||
insert into t_compact select 50 - number from numbers(100) | ||
|
||
statement ok | ||
insert into t select 50 - number from numbers(100) | ||
insert into t_compact select 50 - number from numbers(100) | ||
|
||
query II | ||
select count(),sum(a) from t | ||
select count(),sum(a) from t_compact | ||
---- | ||
200 100 | ||
|
||
statement ok | ||
alter table t set options(row_per_block=10,block_per_segment=10) | ||
alter table t_compact set options(row_per_block=10,block_per_segment=10) | ||
|
||
# lazy compact | ||
statement ok | ||
optimize table t compact | ||
optimize table t_compact compact | ||
|
||
query II | ||
select segment_count, block_count from fuse_snapshot('default', 't') | ||
query I | ||
select count() from fuse_snapshot('default', 't_compact') | ||
---- | ||
4 20 | ||
8 40 | ||
4 20 | ||
3 | ||
|
||
statement ok | ||
alter table t cluster by(abs(a)) | ||
alter table t_compact cluster by(abs(a)) | ||
|
||
# nolazy compact | ||
statement ok | ||
optimize table t compact | ||
optimize table t_compact compact | ||
|
||
query I | ||
select count() from fuse_snapshot('default', 't') | ||
select count() from fuse_snapshot('default', 't_compact') | ||
---- | ||
6 | ||
|
||
query II | ||
select count(),sum(a) from t | ||
select count(),sum(a) from t_compact | ||
---- | ||
200 100 | ||
|
||
statement ok | ||
drop table if exists t | ||
drop table if exists t_compact |