1 | #pragma once |
2 | |
3 | #include <Storages/MergeTree/MergeTreeData.h> |
4 | |
5 | |
6 | namespace DB |
7 | { |
8 | |
9 | /** Completely checks the part data |
10 | * - Calculates checksums and compares them with checksums.txt. |
11 | * - For arrays and strings, checks the correspondence of the size and amount of data. |
12 | * - Checks the correctness of marks. |
13 | * Throws an exception if the part is corrupted or if the check fails (TODO: you can try to separate these cases). |
14 | */ |
15 | MergeTreeData::DataPart::Checksums checkDataPart( |
16 | MergeTreeData::DataPartPtr data_part, |
17 | bool require_checksums, |
18 | const DataTypes & primary_key_data_types, |
19 | const MergeTreeIndices & indices = {}, /// Check skip indices |
20 | std::function<bool()> is_cancelled = []{ return false; }); |
21 | |
22 | MergeTreeData::DataPart::Checksums checkDataPart( |
23 | const String & full_path, |
24 | const MergeTreeIndexGranularity & index_granularity, |
25 | const String & marks_file_extension, |
26 | bool require_checksums, |
27 | const DataTypes & primary_key_data_types, |
28 | const MergeTreeIndices & indices = {}, /// Check skip indices |
29 | std::function<bool()> is_cancelled = []{ return false; }); |
30 | } |
31 | |