From c0133199c866d6d19bea943e7fedf193da913862 Mon Sep 17 00:00:00 2001 From: Alexander Tokmakov Date: Wed, 23 Nov 2022 16:41:43 +0300 Subject: [PATCH] Revert "Add table_uuid to system.parts" --- src/Interpreters/PartLog.cpp | 4 ---- src/Interpreters/PartLog.h | 2 -- src/Storages/MergeTree/MergeTreeData.cpp | 2 -- .../02491_part_log_has_table_uuid.reference | 3 --- .../02491_part_log_has_table_uuid.sql | 16 ---------------- 5 files changed, 27 deletions(-) delete mode 100644 tests/queries/0_stateless/02491_part_log_has_table_uuid.reference delete mode 100644 tests/queries/0_stateless/02491_part_log_has_table_uuid.sql diff --git a/src/Interpreters/PartLog.cpp b/src/Interpreters/PartLog.cpp index 4a1349680fd..b35ee50b98e 100644 --- a/src/Interpreters/PartLog.cpp +++ b/src/Interpreters/PartLog.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include @@ -101,7 +100,6 @@ NamesAndTypesList PartLogElement::getNamesAndTypes() {"database", std::make_shared()}, {"table", std::make_shared()}, - {"table_uuid", std::make_shared()}, {"part_name", std::make_shared()}, {"partition_id", std::make_shared()}, {"part_type", std::make_shared()}, @@ -139,7 +137,6 @@ void PartLogElement::appendToBlock(MutableColumns & columns) const columns[i++]->insert(database_name); columns[i++]->insert(table_name); - columns[i++]->insert(table_uuid); columns[i++]->insert(part_name); columns[i++]->insert(partition_id); columns[i++]->insert(part_type.toString()); @@ -208,7 +205,6 @@ bool PartLog::addNewParts( elem.database_name = table_id.database_name; elem.table_name = table_id.table_name; - elem.table_uuid = table_id.uuid; elem.partition_id = part->info.partition_id; elem.part_name = part->name; elem.disk_name = part->getDataPartStorage().getDiskName(); diff --git a/src/Interpreters/PartLog.h b/src/Interpreters/PartLog.h index 392e76d85d1..2ce0dfd76de 100644 --- a/src/Interpreters/PartLog.h +++ b/src/Interpreters/PartLog.h @@ -4,7 +4,6 @@ #include #include #include -#include #include #include @@ -56,7 +55,6 @@ struct PartLogElement String database_name; String table_name; - UUID table_uuid{UUIDHelpers::Nil}; String part_name; String partition_id; String disk_name; diff --git a/src/Storages/MergeTree/MergeTreeData.cpp b/src/Storages/MergeTree/MergeTreeData.cpp index fcd5afb9947..5c731a03aa8 100644 --- a/src/Storages/MergeTree/MergeTreeData.cpp +++ b/src/Storages/MergeTree/MergeTreeData.cpp @@ -1848,7 +1848,6 @@ void MergeTreeData::removePartsFinally(const MergeTreeData::DataPartsVector & pa part_log_elem.database_name = table_id.database_name; part_log_elem.table_name = table_id.table_name; - part_log_elem.table_uuid = table_id.uuid; for (const auto & part : parts) { @@ -6599,7 +6598,6 @@ try part_log_elem.database_name = table_id.database_name; part_log_elem.table_name = table_id.table_name; - part_log_elem.table_uuid = table_id.uuid; part_log_elem.partition_id = MergeTreePartInfo::fromPartName(new_part_name, format_version).partition_id; part_log_elem.part_name = new_part_name; diff --git a/tests/queries/0_stateless/02491_part_log_has_table_uuid.reference b/tests/queries/0_stateless/02491_part_log_has_table_uuid.reference deleted file mode 100644 index 310e84c6fae..00000000000 --- a/tests/queries/0_stateless/02491_part_log_has_table_uuid.reference +++ /dev/null @@ -1,3 +0,0 @@ -NewPart NotAMerge -MergeParts RegularMerge -RemovePart NotAMerge diff --git a/tests/queries/0_stateless/02491_part_log_has_table_uuid.sql b/tests/queries/0_stateless/02491_part_log_has_table_uuid.sql deleted file mode 100644 index 6291dbab258..00000000000 --- a/tests/queries/0_stateless/02491_part_log_has_table_uuid.sql +++ /dev/null @@ -1,16 +0,0 @@ -create table data_02491 (key Int) engine=MergeTree() order by tuple(); -insert into data_02491 values (1); -optimize table data_02491 final; -truncate table data_02491; - -system flush logs; -with (select uuid from system.tables where database = currentDatabase() and table = 'data_02491') as table_uuid_ -select event_type, merge_reason from system.part_log -where - database = currentDatabase() and - table = 'data_02491' and - table_uuid = table_uuid_ and - table_uuid != toUUIDOrDefault(Null) -order by event_time_microseconds; - -drop table data_02491;