2017-04-01 09:19:00 +00:00
|
|
|
#include <IO/ReadHelpers.h>
|
2017-08-14 18:16:11 +00:00
|
|
|
#include <Storages/MergeTree/MergeTreePartInfo.h>
|
2016-02-03 01:17:58 +00:00
|
|
|
#include <common/LocalDateTime.h>
|
2014-11-05 20:55:33 +00:00
|
|
|
|
|
|
|
|
2017-12-02 02:47:12 +00:00
|
|
|
int main(int, char **)
|
2014-11-05 20:55:33 +00:00
|
|
|
{
|
2018-05-25 13:29:15 +00:00
|
|
|
DayNum today = DateLUT::instance().toDayNum(time(nullptr));
|
2014-11-05 20:55:33 +00:00
|
|
|
|
2018-05-25 13:29:15 +00:00
|
|
|
for (DayNum date = today; DayNum(date + 10) > today; --date)
|
2017-04-01 07:20:54 +00:00
|
|
|
{
|
2017-08-25 20:41:45 +00:00
|
|
|
DB::MergeTreePartInfo part_info("partition", 0, 0, 0);
|
|
|
|
std::string name = part_info.getPartNameV0(date, date);
|
2017-04-01 07:20:54 +00:00
|
|
|
std::cerr << name << '\n';
|
2014-11-05 20:55:33 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
time_t time = DateLUT::instance().YYYYMMDDToDate(DB::parse<UInt32>(name));
|
|
|
|
std::cerr << LocalDateTime(time) << '\n';
|
|
|
|
}
|
2014-11-05 20:55:33 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
return 0;
|
2014-11-05 20:55:33 +00:00
|
|
|
}
|