From 8603807b57f911766710fbde70d06897625fee50 Mon Sep 17 00:00:00 2001 From: Igor Nikonov Date: Sat, 15 Apr 2023 12:33:21 +0000 Subject: [PATCH] Use generic way to parallelize output for file() + disable parallelization for storage Null --- src/Storages/StorageFile.cpp | 10 +--------- src/Storages/StorageNull.h | 2 ++ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/Storages/StorageFile.cpp b/src/Storages/StorageFile.cpp index 1b195d2eb47..7e5a93c13c1 100644 --- a/src/Storages/StorageFile.cpp +++ b/src/Storages/StorageFile.cpp @@ -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)); } diff --git a/src/Storages/StorageNull.h b/src/Storages/StorageNull.h index 2270731c0e3..24ddb311b65 100644 --- a/src/Storages/StorageNull.h +++ b/src/Storages/StorageNull.h @@ -42,6 +42,8 @@ public: std::make_shared(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