#include #include #include #include #include #include #include #include #include #include #include #include #include namespace DB { NamesAndTypesList ProcessorProfileLogElement::getNamesAndTypes() { return { {"hostname", std::make_shared(std::make_shared())}, {"event_date", std::make_shared()}, {"event_time", std::make_shared()}, {"event_time_microseconds", std::make_shared(6)}, {"id", std::make_shared()}, {"parent_ids", std::make_shared(std::make_shared())}, {"plan_step", std::make_shared()}, {"plan_group", std::make_shared()}, {"initial_query_id", std::make_shared()}, {"query_id", std::make_shared()}, {"name", std::make_shared(std::make_shared())}, {"elapsed_us", std::make_shared()}, {"input_wait_elapsed_us", std::make_shared()}, {"output_wait_elapsed_us", std::make_shared()}, {"input_rows", std::make_shared()}, {"input_bytes", std::make_shared()}, {"output_rows", std::make_shared()}, {"output_bytes", std::make_shared()}, }; } void ProcessorProfileLogElement::appendToBlock(MutableColumns & columns) const { size_t i = 0; columns[i++]->insert(getFQDNOrHostName()); columns[i++]->insert(DateLUT::instance().toDayNum(event_time).toUnderType()); columns[i++]->insert(event_time); columns[i++]->insert(event_time_microseconds); columns[i++]->insert(id); { Array parent_ids_array; parent_ids_array.reserve(parent_ids.size()); for (const UInt64 parent : parent_ids) parent_ids_array.emplace_back(parent); columns[i++]->insert(parent_ids_array); } columns[i++]->insert(plan_step); columns[i++]->insert(plan_group); columns[i++]->insertData(initial_query_id.data(), initial_query_id.size()); columns[i++]->insertData(query_id.data(), query_id.size()); columns[i++]->insertData(processor_name.data(), processor_name.size()); columns[i++]->insert(elapsed_us); columns[i++]->insert(input_wait_elapsed_us); columns[i++]->insert(output_wait_elapsed_us); columns[i++]->insert(input_rows); columns[i++]->insert(input_bytes); columns[i++]->insert(output_rows); columns[i++]->insert(output_bytes); } }