This commit is contained in:
kssenii 2022-05-03 15:51:26 +02:00
parent 367898da5e
commit 000f2c9f7a
3 changed files with 8 additions and 4 deletions

View File

@ -60,8 +60,9 @@ void CachedReadBufferFromRemoteFS::appendFilesystemCacheLog(
{
.event_time = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()),
.query_id = query_id,
.remote_file_path = remote_fs_object_path,
.source_file_path = remote_fs_object_path,
.file_segment_range = { file_segment_range.left, file_segment_range.right },
.file_segment_size = file_segment_range.size(),
};
switch (type)

View File

@ -33,8 +33,9 @@ NamesAndTypesList FilesystemCacheLogElement::getNamesAndTypes()
{"event_date", std::make_shared<DataTypeDate>()},
{"event_time", std::make_shared<DataTypeDateTime>()},
{"query_id", std::make_shared<DataTypeString>()},
{"remote_file_path", std::make_shared<DataTypeString>()},
{"source_file_path", std::make_shared<DataTypeString>()},
{"file_segment_range", std::make_shared<DataTypeTuple>(std::move(types))},
{"size", std::make_shared<DataTypeUInt64>()},
{"read_type", std::make_shared<DataTypeString>()},
};
}
@ -48,8 +49,9 @@ void FilesystemCacheLogElement::appendToBlock(MutableColumns & columns) const
columns[i++]->insert(query_id);
columns[i++]->insert(remote_file_path);
columns[i++]->insert(source_file_path);
columns[i++]->insert(Tuple{file_segment_range.first, file_segment_range.second});
columns[i++]->insert(file_segment_size);
columns[i++]->insert(typeToString(read_type));
}

View File

@ -34,10 +34,11 @@ struct FilesystemCacheLogElement
time_t event_time{};
String query_id;
String remote_file_path;
String source_file_path;
std::pair<size_t, size_t> file_segment_range{};
ReadType read_type{};
size_t file_segment_size;
static std::string name() { return "FilesystemCacheLog"; }