2024-05-03 03:21:37 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Tags: no-fasttest, no-shared-merge-tree
|
|
|
|
# Tag no-fasttest: requires S3
|
|
|
|
# Tag no-shared-merge-tree: does not support replication
|
|
|
|
|
|
|
|
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
|
|
# shellcheck source=../shell_config.sh
|
|
|
|
. "$CUR_DIR"/../shell_config.sh
|
|
|
|
|
2024-05-25 01:42:20 +00:00
|
|
|
${CLICKHOUSE_CLIENT} --query "drop table if exists test_s3_mt"
|
2024-05-03 03:21:37 +00:00
|
|
|
|
|
|
|
${CLICKHOUSE_CLIENT} -nm --query "
|
2024-05-25 01:42:20 +00:00
|
|
|
create table test_s3_mt (a Int32, b Int64, c Int64) engine = MergeTree() partition by intDiv(a, 1000) order by tuple(a, b)
|
2024-05-03 03:21:37 +00:00
|
|
|
settings disk = disk(
|
2024-05-25 01:42:20 +00:00
|
|
|
name = 03008_s3_plain_rewritable,
|
2024-05-03 03:21:37 +00:00
|
|
|
type = s3_plain_rewritable,
|
2024-05-25 01:42:20 +00:00
|
|
|
endpoint = 'http://localhost:11111/test/03008_test_s3_mt/',
|
2024-05-03 03:21:37 +00:00
|
|
|
access_key_id = clickhouse,
|
|
|
|
secret_access_key = clickhouse);
|
|
|
|
"
|
|
|
|
|
|
|
|
${CLICKHOUSE_CLIENT} -nm --query "
|
2024-05-25 01:42:20 +00:00
|
|
|
insert into test_s3_mt (*) values (1, 2, 0), (2, 2, 2), (3, 1, 9), (4, 7, 7), (5, 10, 2), (6, 12, 5);
|
|
|
|
insert into test_s3_mt (*) select number, number, number from numbers_mt(10000);
|
|
|
|
select count(*) from test_s3_mt;
|
|
|
|
select (*) from test_s3_mt order by tuple(a, b) limit 10;
|
2024-05-03 03:21:37 +00:00
|
|
|
"
|
|
|
|
|
2024-05-25 01:42:20 +00:00
|
|
|
${CLICKHOUSE_CLIENT} --query "optimize table test_s3_mt final"
|
2024-05-03 03:21:37 +00:00
|
|
|
|
|
|
|
${CLICKHOUSE_CLIENT} -m --query "
|
2024-05-25 01:42:20 +00:00
|
|
|
alter table test_s3_mt add projection test_s3_mt_projection (select * order by b)" 2>&1 | grep -Fq "SUPPORT_IS_DISABLED"
|
2024-05-03 03:21:37 +00:00
|
|
|
|
|
|
|
${CLICKHOUSE_CLIENT} -nm --query "
|
2024-05-25 01:42:20 +00:00
|
|
|
alter table test_s3_mt update c = 0 where a % 2 = 1;
|
|
|
|
alter table test_s3_mt add column d Int64 after c;
|
|
|
|
alter table test_s3_mt drop column c;
|
2024-05-03 03:21:37 +00:00
|
|
|
" 2>&1 | grep -Fq "SUPPORT_IS_DISABLED"
|
|
|
|
|
|
|
|
${CLICKHOUSE_CLIENT} -nm --query "
|
2024-05-25 01:42:20 +00:00
|
|
|
detach table test_s3_mt;
|
|
|
|
attach table test_s3_mt;
|
2024-05-03 03:21:37 +00:00
|
|
|
"
|
|
|
|
|
2024-05-25 01:42:20 +00:00
|
|
|
${CLICKHOUSE_CLIENT} --query "drop table if exists test_s3_mt_dst"
|
2024-05-03 03:21:37 +00:00
|
|
|
|
|
|
|
${CLICKHOUSE_CLIENT} -m --query "
|
2024-05-25 01:42:20 +00:00
|
|
|
create table test_s3_mt_dst (a Int32, b Int64, c Int64) engine = MergeTree() partition by intDiv(a, 1000) order by tuple(a, b)
|
2024-08-07 17:19:33 +00:00
|
|
|
settings disk = disk(
|
|
|
|
name = 03008_s3_plain_rewritable,
|
|
|
|
type = s3_plain_rewritable,
|
|
|
|
endpoint = 'http://localhost:11111/test/03008_test_s3_mt/',
|
|
|
|
access_key_id = clickhouse,
|
|
|
|
secret_access_key = clickhouse);
|
2024-05-03 03:21:37 +00:00
|
|
|
"
|
|
|
|
|
|
|
|
${CLICKHOUSE_CLIENT} -m --query "
|
2024-05-25 01:42:20 +00:00
|
|
|
alter table test_s3_mt move partition 0 to table test_s3_mt_dst" 2>&1 | grep -Fq "SUPPORT_IS_DISABLED"
|
|
|
|
|
|
|
|
${CLICKHOUSE_CLIENT} --query "drop table test_s3_mt sync"
|