Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyass committed Sep 8, 2023
1 parent b0f76b1 commit f17cf2e
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions tests/sqllogictests/suites/mode/cluster/distributed_compact.sql
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

0 comments on commit f17cf2e

Please sign in to comment.