Fix errors

This commit is contained in:
Alexey Milovidov 2021-01-03 00:29:49 +03:00
parent 4012f9ef8b
commit 2881b3cf30
2 changed files with 3 additions and 5 deletions

View File

@ -82,6 +82,8 @@ CheckResults FileChecker::check() const
void FileChecker::repair()
{
initialize();
for (const auto & name_size : map)
{
const String & name = name_size.first;

View File

@ -95,7 +95,7 @@ private:
struct Stream
{
Stream(const DiskPtr & disk, const String & data_path, size_t max_read_buffer_size_, size_t file_size)
: plain(disk->readFile(data_path, std::min(max_read_buffer_size_, file_size))),
: plain(file_size ? disk->readFile(data_path, std::min(max_read_buffer_size_, file_size)) : std::make_unique<ReadBuffer>(nullptr, 0)),
limited(std::make_unique<LimitReadBuffer>(*plain, file_size, false)),
compressed(*limited)
{
@ -132,10 +132,6 @@ Chunk TinyLogSource::generate()
return {};
}
/// if there are no files in the folder, it means that the table is empty
if (storage.disk->isDirectoryEmpty(storage.table_path))
return {};
for (const auto & name_type : columns)
{
MutableColumnPtr column = name_type.type->createColumn();