#include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace DB { Block PartLogElement::createBlock() { return { {std::make_shared(), std::make_shared(), "event_type"}, {std::make_shared(), std::make_shared(), "event_date"}, {std::make_shared(), std::make_shared(), "event_time"}, {std::make_shared(), std::make_shared(), "size_in_bytes"}, {std::make_shared(), std::make_shared(), "duration_ms"}, {std::make_shared(), std::make_shared(), "database"}, {std::make_shared(), std::make_shared(), "table"}, {std::make_shared(), std::make_shared(), "part_name"}, {std::make_shared(std::make_shared()), std::make_shared(std::make_shared()), "merged_from"}, }; } void PartLogElement::appendToBlock(Block & block) const { size_t i = 0; block.getByPosition(i++).column->insert(UInt64(event_type)); block.getByPosition(i++).column->insert(UInt64(DateLUT::instance().toDayNum(event_time))); block.getByPosition(i++).column->insert(UInt64(event_time)); block.getByPosition(i++).column->insert(UInt64(size_in_bytes)); block.getByPosition(i++).column->insert(UInt64(duration_ms)); block.getByPosition(i++).column->insert(database_name); block.getByPosition(i++).column->insert(table_name); block.getByPosition(i++).column->insert(part_name); Array merged_from_array; merged_from_array.reserve(merged_from.size()); for (const auto & name : merged_from) merged_from_array.push_back(name); block.getByPosition(i++).column->insert(merged_from_array); } }