Use generic way to parallelize output for file()

+ disable parallelization for storage Null
This commit is contained in:
Igor Nikonov 2023-04-15 12:33:21 +00:00
parent 6c03b2ef0c
commit 8603807b57
2 changed files with 3 additions and 9 deletions

View File

@ -791,15 +791,7 @@ Pipe StorageFile::read(
std::move(read_buffer)));
}
Pipe pipe = Pipe::unitePipes(std::move(pipes));
/// Parallelize output as much as possible
/// Note: number of streams can be 0 if paths is empty
/// It happens if globs in file(path, ...) expands to empty set i.e. no files to process
if (num_streams > 0 && num_streams < max_num_streams)
{
pipe.resize(max_num_streams);
}
return pipe;
return Pipe::unitePipes(std::move(pipes));
}

View File

@ -42,6 +42,8 @@ public:
std::make_shared<NullSource>(storage_snapshot->getSampleBlockForColumns(column_names)));
}
bool parallelizeOutputAfterReading() const override { return false; }
bool supportsParallelInsert() const override { return true; }
SinkToStoragePtr write(const ASTPtr &, const StorageMetadataPtr & metadata_snapshot, ContextPtr) override