Some fixes

This commit is contained in:
avogar 2022-06-21 17:34:08 +00:00
parent 77a0c47591
commit 13a05adcb9
2 changed files with 7 additions and 3 deletions

View File

@ -84,8 +84,8 @@ public:
if (schema_info.ttl)
{
/// Current value in cache is valid and we can resume it's TTL bu updating it's expiration time.
/// We will extract current value from the expiration queue, modify it and insert back to the queue..
/// Current value in cache is valid and we can resume it's TTL by updating it's expiration time.
/// We will extract current value from the expiration queue, modify it and insert back to the queue.
time_t now = std::time(nullptr);
auto jt = expiration_queue.find({schema_info.valid_until, key});
auto node = expiration_queue.extract(jt);

View File

@ -208,7 +208,11 @@ ColumnsDescription StorageHDFS::getTableStructureFromData(
std::make_unique<ReadBufferFromHDFS>(uri_without_path, *it++, ctx->getGlobalContext()->getConfigRef()), compression);
};
auto columns = readSchemaFromFormat(format, std::nullopt, read_buffer_iterator, paths.size() > 1, ctx);
ColumnsDescription columns;
if (columns_from_cache)
columns = *columns_from_cache;
else
columns = readSchemaFromFormat(format, std::nullopt, read_buffer_iterator, paths.size() > 1, ctx);
if (ctx->getSettingsRef().use_cache_for_hdfs_schema_inference)
addColumnsToCache(paths, columns, ctx);