mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 05:32:52 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
22 lines
594 B
C++
22 lines
594 B
C++
#include <IO/ReadHelpers.h>
|
|
#include <Storages/MergeTree/MergeTreePartInfo.h>
|
|
#include <common/LocalDateTime.h>
|
|
|
|
|
|
int main(int, char **)
|
|
{
|
|
DayNum today = DateLUT::instance().toDayNum(time(nullptr));
|
|
|
|
for (DayNum date = today; DayNum(date + 10) > today; --date)
|
|
{
|
|
DB::MergeTreePartInfo part_info("partition", 0, 0, 0);
|
|
std::string name = part_info.getPartNameV0(date, date);
|
|
std::cerr << name << '\n';
|
|
|
|
time_t time = DateLUT::instance().YYYYMMDDToDate(DB::parse<UInt32>(name));
|
|
std::cerr << LocalDateTime(time) << '\n';
|
|
}
|
|
|
|
return 0;
|
|
}
|