Skip to content

Commit 5a2542a

Browse files
authored
Merge pull request ClickHouse#80103 from ClickHouse/parallel-replicas-replace-log-memory
Stateless tests: replace Log* and Memory engines to MergeTree in parallel replicas job
2 parents a63198a + 165241b commit 5a2542a

File tree

89 files changed

+318
-171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+318
-171
lines changed

tests/clickhouse-test

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,13 @@ class SharedEngineReplacer:
204204

205205
def _need_to_replace_something(self):
206206
return (
207-
(self.replace_replicated or self.replace_non_replicated)
208-
and "shared_merge_tree" not in self.file_name
209-
) or self.cloud
207+
(
208+
(self.replace_replicated or self.replace_non_replicated)
209+
and "shared_merge_tree" not in self.file_name
210+
)
211+
or self.cloud
212+
or self.args.replace_log_memory_with_mergetree
213+
)
210214

211215
def _has_show_create_table(self):
212216
with open(self.file_name, "r", encoding="utf-8") as f:
@@ -230,9 +234,12 @@ class SharedEngineReplacer:
230234
data_engines = r"(Engine\s*=?\s*)(Log|TinyLog|StripeLog|Memory)\(?\)?"
231235
# Replace them with SMT
232236
replace_with = f"{replace_engine}() ORDER BY tuple()"
237+
if self.reference_file and not self.with_echo:
238+
replace_with = f"{replace_engine}\\nORDER BY tuple()\\nSETTINGS index_granularity = 8192"
239+
233240
if (
234241
re.search(data_engines, line, flags=re.IGNORECASE)
235-
and "CREATE DATABASE" not in line
242+
and "CREATE DATABASE" not in line.upper()
236243
):
237244
modified_statement = re.sub(
238245
data_engines,
@@ -284,6 +291,7 @@ class SharedEngineReplacer:
284291
self.replace_non_replicated = replace_non_replicated
285292
self.reference_file = reference_file
286293
self.cloud = cloud
294+
self.with_echo = False
287295
use_random_path = not reference_file and not self._has_show_create_table()
288296

289297
if not self._need_to_replace_something():
@@ -298,10 +306,18 @@ class SharedEngineReplacer:
298306
):
299307
for line in source:
300308
# Replace table engines if echo enabled to match changed reference
301-
if self.cloud and line.startswith("-- { echo"):
309+
if (
310+
self.cloud or self.args.replace_log_memory_with_mergetree
311+
) and re.match("-- ?\{ ?echo.*", line):
312+
self.with_echo = True
313+
314+
if self.cloud and self.with_echo:
302315
self.replace_replicated = True
303316
self.replace_non_replicated = True
304317

318+
if self.args.replace_log_memory_with_mergetree:
319+
line = self._replace_data_engines(line, replace_engine="MergeTree")
320+
305321
if (
306322
self._is_select_line(line)
307323
or (reference_file and not self._is_create_query(line))
@@ -1457,6 +1473,12 @@ class TestCase:
14571473
if "no-async-insert" in tags and args.no_async_insert:
14581474
return FailureReason.NO_ASYNC_INSERT
14591475

1476+
# Do not run *Log and Memory engine-specific tests
1477+
if (
1478+
"memory-engine" in tags or "log-engine" in tags
1479+
) and args.replace_log_memory_with_mergetree:
1480+
return FailureReason.NOT_SUPPORTED
1481+
14601482
if args.skip and any(s in self.name for s in args.skip):
14611483
return FailureReason.SKIP
14621484

@@ -3835,6 +3857,12 @@ def parse_args():
38353857
default=os.environ.get("REPLACE_MT_WITH_SMT", False),
38363858
help="Replace ordinary MergeTree engine with SharedMergeTree",
38373859
)
3860+
parser.add_argument(
3861+
"--replace-log-memory-with-mergetree",
3862+
action="store_true",
3863+
default=os.environ.get("REPLACE_LOG_MEM_WITH_MT", False),
3864+
help="Replace *Log and Memory engines with MergeTree",
3865+
)
38383866

38393867
parser.add_argument(
38403868
"--client-log",

tests/docker_scripts/stateless_runner.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ function run_tests()
335335
ADDITIONAL_OPTIONS+=('--no-parallel-replicas')
336336
ADDITIONAL_OPTIONS+=('--no-zookeeper')
337337
ADDITIONAL_OPTIONS+=('--no-shard')
338+
ADDITIONAL_OPTIONS+=('--replace-log-memory-with-mergetree')
338339
else
339340
ADDITIONAL_OPTIONS+=('--zookeeper')
340341
ADDITIONAL_OPTIONS+=('--shard')

tests/parallel_replicas_blacklist.txt

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
03045_unknown_identifier_alias_substitution
1111
02561_temporary_table_sessions
1212
02525_different_engines_in_temporary_tables
13+
00645_date_time_input_format
14+
02154_default_keyword_insert
15+
02807_default_date_time_nullable
1316

1417
https://github.com/ClickHouse/ClickHouse/issues/74324
1518
MULTIPLE_EXPRESSIONS_FOR_ALIAS
@@ -36,6 +39,13 @@
3639
https://github.com/ClickHouse/ClickHouse/issues/74343
3740
Cannot find column `tuple(col_a, type)` in source stream, there are only columns: [__table1.id, tuple(replaceAll(__table1.data, 'a'_String, 'e'_String), __table1.type), tuple(replaceAll(__table1.data, 'a'_String, 'e'_String), __table1.type)]. (THERE_IS_NO_COLUMN) (in query: SELECT id, tuple(replaceAll(data, 'a', 'e') AS col_a, type) AS a, tuple(replaceAll(data, 'a', 'e') AS col_b, type) AS b FROM src;)
3841
03240_insert_select_named_tuple
42+
00500_point_in_polygon_non_const_poly
43+
01017_tuplehamming_distance
44+
01300_svg
45+
01849_geoToS2
46+
02504_regexp_dictionary_table_source
47+
02833_tuple_concat
48+
02378_analyzer_projection_names
3949

4050
https://github.com/ClickHouse/ClickHouse/issues/74367
4151
Cannot find column in source stream
@@ -74,6 +84,7 @@
7484
01594_storage_join_uuid
7585
Unsupported JOIN keys of type keys256 in StorageJoin: While executing Join. (UNSUPPORTED_JOIN_KEYS) (query: SELECT * FROM t1 ALL INNER JOIN tj USING (key1, key2, key3) ORDER BY key1;)
7686
02498_storage_join_key_positions.gen
87+
03447_storage_join_unsupported_keys
7788

7889
https://github.com/ClickHouse/ClickHouse/pull/73609
7990
Cannot parse string
@@ -130,6 +141,10 @@
130141
02950_dictionary_ssd_cache_short_circuit
131142
02504_regexp_dictionary_ua_parser
132143
03062_analyzer_join_engine_missing_column
144+
01852_dictionary_query_count_long
145+
01904_dictionary_default_nullable_type
146+
02391_hashed_dictionary_shards
147+
02740_hashed_dictionary_load_factor_smoke
133148

134149
https://github.com/ClickHouse/clickhouse-private/issues/11670
135150
Actual WithMergeableState
@@ -157,7 +172,8 @@
157172
01780_column_sparse_full
158173
01783_merge_engine_join_key_condition
159174
02789_filesystem_cache_alignment
160-
175+
00475_in_join_db_table
176+
03325_sqlite_join_wrong_answer
161177

162178
https://github.com/ClickHouse/clickhouse-private/issues/17173
163179
02023_transform_or_to_in
@@ -183,6 +199,30 @@
183199
https://github.com/ClickHouse/ClickHouse/issues/74411
184200
02884_create_view_with_sql_security_option
185201

202+
https://github.com/ClickHouse/ClickHouse/issues/80426
203+
Duplicates with all right join and join engine
204+
01051_all_join_engine
205+
02497_storage_join_right_assert
206+
02495_analyzer_storage_join
207+
208+
https://github.com/ClickHouse/clickhouse-private/issues/27882
209+
duplicates cross_to_inner_join_rewrite=1
210+
02564_analyzer_cross_to_inner
211+
212+
https://github.com/ClickHouse/ClickHouse/issues/80439
213+
Predicate pushdown CTE incorrect result
214+
02901_predicate_pushdown_cte_stateful
215+
216+
https://github.com/ClickHouse/ClickHouse/issues/80440
217+
MULTIPLE_EXPRESSIONS_FOR_ALIAS
218+
03121_analyzer_filed_redefenition_in_subquery
219+
220+
Correlated subqueries are not supported
221+
Cannot clone ReadFromPreparedSource plan step. (NOT_IMPLEMENTED)
222+
03448_analyzer_correlated_subquery_in_projection
223+
03412_analyzer_correlated_subquery_bug
224+
03399_analyzer_correlated_subquery
225+
186226
Transactions
187227
02421_truncate_isolation_no_merges
188228
02421_truncate_isolation_with_mutations
@@ -327,6 +367,7 @@
327367
00175_partition_by_ignore
328368
01655_plan_optimizations_optimize_read_in_window_order
329369
01625_constraints_index_append
370+
01883_with_grouping_sets
330371
Query memory limit exceeded: would use 19.63 MiB (attempt to allocate chunk of 1308788 bytes), current RSS 21.39 MiB, maximum: 19.07 MiB. (MEMORY_LIMIT_EXCEEDED
331372
01655_plan_optimizations_optimize_read_in_window_order_long
332373
01824_move_to_prewhere_many_columns
@@ -384,6 +425,8 @@
384425
03262_filter_push_down_view
385426
01283_max_threads_simple_query_optimization
386427
00183_prewhere_conditions_order
428+
03302_analyzer_join_filter_push_down_bug
429+
02815_join_algorithm_setting
387430

388431
# NOT BUGS
389432
Not a bug

tests/queries/0_stateless/00063_check_query.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
-- Tags: log-engine
2+
13
SET check_query_single_value_result = 1;
24

35
DROP TABLE IF EXISTS check_query_tiny_log;

tests/queries/0_stateless/00080_show_tables_and_system_tables.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
-- Tags: log-engine
12

23
DROP DATABASE IF EXISTS {CLICKHOUSE_DATABASE:Identifier};
34

tests/queries/0_stateless/00305_http_and_readonly.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bash
2+
# Tags: log-engine
23

34
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
45
# shellcheck source=../shell_config.sh

tests/queries/0_stateless/00340_squashing_insert_select.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
-- Tags: log-engine
2+
13
DROP TABLE IF EXISTS numbers_squashed;
24
CREATE TABLE numbers_squashed AS system.numbers ENGINE = StripeLog;
35

tests/queries/0_stateless/00341_squashing_insert_select2.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
-- Tags: log-engine
2+
13
DROP TABLE IF EXISTS numbers_squashed;
24
CREATE TABLE numbers_squashed (number UInt8) ENGINE = StripeLog;
35

tests/queries/0_stateless/00366_multi_statements.reference

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,26 @@ Syntax error
2424
5
2525
6
2626
1
27-
2
28-
3
29-
4
30-
5
31-
6
3227
1
3328
2
34-
3
35-
1
3629
2
3730
3
31+
3
3832
4
3933
5
4034
6
4135
1
36+
1
4237
2
38+
2
39+
3
4340
3
4441
4
42+
4
43+
5
4544
5
4645
6
46+
6
4747
1
4848
1
4949
1
@@ -53,55 +53,55 @@ Syntax error
5353
Syntax error
5454
Syntax error
5555
1
56-
2
57-
3
58-
4
59-
5
60-
6
6156
1
62-
2
63-
3
64-
4
65-
5
66-
6
6757
1
6858
2
69-
3
70-
1
7159
2
72-
3
73-
4
74-
5
75-
6
76-
1
7760
2
7861
3
79-
4
80-
5
81-
6
82-
1
83-
2
8462
3
85-
4
86-
5
87-
6
88-
1
89-
2
9063
3
9164
4
65+
4
66+
5
9267
5
9368
6
69+
6
70+
1
9471
1
72+
1
73+
2
9574
2
75+
2
76+
3
9677
3
78+
3
79+
4
9780
4
81+
4
82+
5
83+
5
9884
5
9985
6
86+
6
87+
6
10088
1
89+
1
90+
1
91+
2
92+
2
10193
2
10294
3
95+
3
96+
3
97+
4
98+
4
10399
4
104100
5
101+
5
102+
5
103+
6
104+
6
105105
6
106106
7
107107
8

tests/queries/0_stateless/00366_multi_statements.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ $CLICKHOUSE_CLIENT --query="SELECT 1; SELECT 2; SELECT" 2>&1 | grep -o 'Syntax e
2222
$CLICKHOUSE_CLIENT --query="DROP TABLE IF EXISTS t_00366; CREATE TABLE t_00366 (x UInt64) ENGINE = TinyLog;"
2323

2424
$CLICKHOUSE_CLIENT --query="INSERT INTO t_00366 VALUES (1),(2),(3);"
25-
$CLICKHOUSE_CLIENT --query="SELECT * FROM t_00366"
25+
$CLICKHOUSE_CLIENT --query="SELECT * FROM t_00366 ORDER BY ALL"
2626
$CLICKHOUSE_CLIENT --query="INSERT INTO t_00366 VALUES" <<< "(4),(5),(6)"
27-
$CLICKHOUSE_CLIENT --query="SELECT * FROM t_00366"
27+
$CLICKHOUSE_CLIENT --query="SELECT * FROM t_00366 ORDER BY ALL"
2828

2929
$CLICKHOUSE_CLIENT --query="INSERT INTO t_00366 VALUES (1),(2),(3);"
30-
$CLICKHOUSE_CLIENT --query="SELECT * FROM t_00366"
30+
$CLICKHOUSE_CLIENT --query="SELECT * FROM t_00366 ORDER BY ALL"
3131
$CLICKHOUSE_CLIENT --query="INSERT INTO t_00366 VALUES" <<< "(4),(5),(6)"
32-
$CLICKHOUSE_CLIENT --query="SELECT * FROM t_00366"
32+
$CLICKHOUSE_CLIENT --query="SELECT * FROM t_00366 ORDER BY ALL"
3333

3434
${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}" -d "SELECT 1"
3535
${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}" -d "SELECT 1;"
@@ -42,10 +42,10 @@ ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}" -d "SELECT 1; SELECT 2;" 2>&1 | grep
4242
${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}" -d "SELECT 1; SELECT 2; SELECT" 2>&1 | grep -o 'Syntax error'
4343

4444
${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}" -d "INSERT INTO t_00366 VALUES (1),(2),(3);"
45-
$CLICKHOUSE_CLIENT --query="SELECT * FROM t_00366"
45+
$CLICKHOUSE_CLIENT --query="SELECT * FROM t_00366 ORDER BY ALL"
4646
${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}&query=INSERT" -d "INTO t_00366 VALUES (4),(5),(6);"
47-
$CLICKHOUSE_CLIENT --query="SELECT * FROM t_00366"
47+
$CLICKHOUSE_CLIENT --query="SELECT * FROM t_00366 ORDER BY ALL"
4848
${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}&query=INSERT+INTO+t_00366+VALUES" -d "(7),(8),(9)"
49-
$CLICKHOUSE_CLIENT --query="SELECT * FROM t_00366"
49+
$CLICKHOUSE_CLIENT --query="SELECT * FROM t_00366 ORDER BY ALL"
5050

5151
$CLICKHOUSE_CLIENT --query="DROP TABLE t_00366;"

0 commit comments

Comments
 (0)