1 | #include <IO/ReadHelpers.h> |
---|---|
2 | #include <Storages/MergeTree/MergeTreePartInfo.h> |
3 | #include <common/LocalDateTime.h> |
4 | |
5 | |
6 | int main(int, char **) |
7 | { |
8 | DayNum today = DateLUT::instance().toDayNum(time(nullptr)); |
9 | |
10 | for (DayNum date = today; DayNum(date + 10) > today; --date) |
11 | { |
12 | DB::MergeTreePartInfo part_info("partition", 0, 0, 0); |
13 | std::string name = part_info.getPartNameV0(date, date); |
14 | std::cerr << name << '\n'; |
15 | |
16 | time_t time = DateLUT::instance().YYYYMMDDToDate(DB::parse<UInt32>(name)); |
17 | std::cerr << LocalDateTime(time) << '\n'; |
18 | } |
19 | |
20 | return 0; |
21 | } |
22 |