Skip to content

Commit 8f171b8

Browse files
committed
fiox tests
1 parent 44c697c commit 8f171b8

File tree

2 files changed

+9
-24
lines changed

2 files changed

+9
-24
lines changed

tests/queries/0_stateless/03572_export_mt_part_to_object_storage.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
77
mt_table="mt_table_${RANDOM}"
88
s3_table="s3_table_${RANDOM}"
99
mt_table_roundtrip="mt_table_roundtrip_${RANDOM}"
10-
invalid_schema_table="invalid_schema_table_${RANDOM}"
1110

1211
query() {
1312
$CLICKHOUSE_CLIENT --query "$1"
1413
}
1514

16-
query "DROP TABLE IF EXISTS $mt_table, $s3_table, $mt_table_roundtrip, $invalid_schema_table"
15+
query "DROP TABLE IF EXISTS $mt_table, $s3_table, $mt_table_roundtrip"
1716

1817
query "CREATE TABLE $mt_table (id UInt64, year UInt16) ENGINE = MergeTree() PARTITION BY year ORDER BY tuple()"
1918
query "CREATE TABLE $s3_table (id UInt64, year UInt16) ENGINE = S3(s3_conn, filename='$s3_table', format=Parquet, partition_strategy='hive') PARTITION BY year"
@@ -50,11 +49,5 @@ query "CREATE TABLE $mt_table_roundtrip ENGINE = MergeTree() PARTITION BY year O
5049
echo "---- Data in roundtrip MergeTree table (should match s3_table)"
5150
query "SELECT DISTINCT ON (id) * FROM $mt_table_roundtrip ORDER BY id"
5251

53-
# Create a table with a different partition key and export a partition to it. It should throw
54-
query "CREATE TABLE $invalid_schema_table (id UInt64, x UInt16) ENGINE = S3(s3_conn, filename='$invalid_schema_table', format=Parquet, partition_strategy='hive') PARTITION BY x"
55-
query "ALTER TABLE $mt_table EXPORT PARTITION ID '2020' TO TABLE $invalid_schema_table SETTINGS allow_experimental_export_merge_tree_partition = 1 -- {serverError INCOMPATIBLE_COLUMNS}"
56-
57-
query "DROP TABLE $invalid_schema_table"
58-
5952
query "SYSTEM START MERGES"
6053
query "DROP TABLE IF EXISTS $mt_table, $s3_table, $mt_table_roundtrip"

tests/queries/0_stateless/03572_export_mt_part_to_object_storage_simple.sql

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,15 @@ CREATE TABLE 03572_mt_table (id UInt64, year UInt16) ENGINE = MergeTree() PARTIT
77
INSERT INTO 03572_mt_table VALUES (1, 2020);
88

99
-- Create a table with a different partition key and export a partition to it. It should throw
10-
CREATE TABLE 03572_invalid_schema_table (id UInt64, x UInt16)
11-
ENGINE = S3(
12-
s3_conn,
13-
filename='03572_invalid_schema_table',
14-
format=Parquet, partition_strategy='hive') PARTITION BY x;
10+
CREATE TABLE 03572_invalid_schema_table (id UInt64, x UInt16) ENGINE = S3(s3_conn, filename='03572_invalid_schema_table', format='Parquet', partition_strategy='hive') PARTITION BY x;
1511

16-
ALTER TABLE $mt_table EXPORT PARTITION ID '2020' TO TABLE 03572_invalid_schema_table
17-
SETTINGS allow_experimental_export_merge_tree_partition = 1 -- {serverError BAD_ARGUMENTS}
12+
ALTER TABLE 03572_mt_table EXPORT PARTITION ID '2020' TO TABLE 03572_invalid_schema_table
13+
SETTINGS allow_experimental_export_merge_tree_partition = 1; -- {serverError INCOMPATIBLE_COLUMNS}
1814

15+
DROP TABLE 03572_invalid_schema_table;
1916

2017
-- The only partition strategy that supports exports is hive. Wildcard should throw
21-
CREATE TABLE 03572_invalid_schema_table (id UInt64, year UInt16)
22-
ENGINE = S3(
23-
s3_conn,
24-
filename='03572_invalid_schema_table/{_partition_id}',
25-
format=Parquet,
26-
partition_strategy='wildcard') PARTITION BY (id, year);
27-
28-
ALTER TABLE $mt_table EXPORT PARTITION ID '2020' TO TABLE 03572_invalid_schema_table
29-
SETTINGS allow_experimental_export_merge_tree_partition = 1 -- {serverError NOT_IMPLEMENTED}
18+
CREATE TABLE 03572_invalid_schema_table (id UInt64, year UInt16) ENGINE = S3(s3_conn, filename='03572_invalid_schema_table/{_partition_id}', format='Parquet', partition_strategy='wildcard') PARTITION BY (id, year);
19+
20+
ALTER TABLE 03572_mt_table EXPORT PARTITION ID '2020' TO TABLE 03572_invalid_schema_table
21+
SETTINGS allow_experimental_export_merge_tree_partition = 1; -- {serverError NOT_IMPLEMENTED}

0 commit comments

Comments
 (0)