From 2a09aa53cccc1b680cf681be977a20ad6011ba89 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Wed, 26 Aug 2020 19:41:30 +0300 Subject: [PATCH] Support parallel INSERT for more table engines --- src/Storages/StorageBuffer.h | 2 ++ src/Storages/StorageDistributed.h | 2 ++ src/Storages/StorageMemory.h | 2 ++ src/Storages/StorageNull.h | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/Storages/StorageBuffer.h b/src/Storages/StorageBuffer.h index 4b7fa763678..8f1354399ef 100644 --- a/src/Storages/StorageBuffer.h +++ b/src/Storages/StorageBuffer.h @@ -65,6 +65,8 @@ public: size_t max_block_size, unsigned num_streams) override; + bool supportsParallelInsert() const override { return true; } + BlockOutputStreamPtr write(const ASTPtr & query, const StorageMetadataPtr & /*metadata_snapshot*/, const Context & context) override; void startup() override; diff --git a/src/Storages/StorageDistributed.h b/src/Storages/StorageDistributed.h index b7663676d52..aafd5b754f9 100644 --- a/src/Storages/StorageDistributed.h +++ b/src/Storages/StorageDistributed.h @@ -79,6 +79,8 @@ public: size_t max_block_size, unsigned num_streams) override; + bool supportsParallelInsert() const override { return true; } + BlockOutputStreamPtr write(const ASTPtr & query, const StorageMetadataPtr & /*metadata_snapshot*/, const Context & context) override; /// Removes temporary data in local filesystem. diff --git a/src/Storages/StorageMemory.h b/src/Storages/StorageMemory.h index 24eee7897bf..886a4165f29 100644 --- a/src/Storages/StorageMemory.h +++ b/src/Storages/StorageMemory.h @@ -37,6 +37,8 @@ public: size_t max_block_size, unsigned num_streams) override; + bool supportsParallelInsert() const override { return true; } + BlockOutputStreamPtr write(const ASTPtr & query, const StorageMetadataPtr & metadata_snapshot, const Context & context) override; void drop() override; diff --git a/src/Storages/StorageNull.h b/src/Storages/StorageNull.h index 226eb05ccf9..b5387c6b924 100644 --- a/src/Storages/StorageNull.h +++ b/src/Storages/StorageNull.h @@ -35,6 +35,8 @@ public: std::make_shared(metadata_snapshot->getSampleBlockForColumns(column_names, getVirtuals(), getStorageID()))); } + bool supportsParallelInsert() const override { return true; } + BlockOutputStreamPtr write(const ASTPtr &, const StorageMetadataPtr & metadata_snapshot, const Context &) override { return std::make_shared(metadata_snapshot->getSampleBlock());