From e817d814bfbaa30d59a51aa9e0a9400d6f146630 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 21 Oct 2024 22:45:39 +0200 Subject: [PATCH] Add a test --- .../0_stateless/03254_merge_source_parts.reference | 1 + tests/queries/0_stateless/03254_merge_source_parts.sql | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 tests/queries/0_stateless/03254_merge_source_parts.reference create mode 100644 tests/queries/0_stateless/03254_merge_source_parts.sql diff --git a/tests/queries/0_stateless/03254_merge_source_parts.reference b/tests/queries/0_stateless/03254_merge_source_parts.reference new file mode 100644 index 00000000000..629479b40a2 --- /dev/null +++ b/tests/queries/0_stateless/03254_merge_source_parts.reference @@ -0,0 +1 @@ +1 2 2 1 diff --git a/tests/queries/0_stateless/03254_merge_source_parts.sql b/tests/queries/0_stateless/03254_merge_source_parts.sql new file mode 100644 index 00000000000..3324cdf2aa0 --- /dev/null +++ b/tests/queries/0_stateless/03254_merge_source_parts.sql @@ -0,0 +1,8 @@ +DROP TABLE IF EXISTS test; +CREATE TABLE test (x UInt8) ORDER BY x; +INSERT INTO test VALUES (1); +INSERT INTO test VALUES (2); +OPTIMIZE TABLE test FINAL; +SYSTEM FLUSH LOGS; +SELECT ProfileEvents['Merge'], ProfileEvents['MergeSourceParts'], ProfileEvents['MergedRows'], ProfileEvents['MergedColumns'] FROM system.part_log WHERE database = currentDatabase() AND table = 'test' AND event_type = 'MergeParts'; +DROP TABLE test;