mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-29 19:12:03 +00:00
Do not build multithread insert pipeline for tables without support
This commit is contained in:
parent
f8ef9fc5d3
commit
8b2c719aa6
@ -522,7 +522,8 @@ BlockIO InterpreterInsertQuery::execute()
|
|||||||
auto views = DatabaseCatalog::instance().getDependentViews(table_id);
|
auto views = DatabaseCatalog::instance().getDependentViews(table_id);
|
||||||
|
|
||||||
/// It breaks some views-related tests and we have dedicated `parallel_view_processing` for views, so let's just skip them.
|
/// It breaks some views-related tests and we have dedicated `parallel_view_processing` for views, so let's just skip them.
|
||||||
const bool resize_to_max_insert_threads = !table->isView() && views.empty();
|
/// Also it doesn't make sense to reshuffle data if storage doesn't support parallel inserts.
|
||||||
|
const bool resize_to_max_insert_threads = !table->isView() && views.empty() && table->supportsParallelInsert();
|
||||||
pre_streams_size = resize_to_max_insert_threads ? settings.max_insert_threads
|
pre_streams_size = resize_to_max_insert_threads ? settings.max_insert_threads
|
||||||
: std::min<size_t>(settings.max_insert_threads, pipeline.getNumStreams());
|
: std::min<size_t>(settings.max_insert_threads, pipeline.getNumStreams());
|
||||||
|
|
||||||
|
@ -13,8 +13,6 @@
|
|||||||
#include <QueryPipeline/ReadProgressCallback.h>
|
#include <QueryPipeline/ReadProgressCallback.h>
|
||||||
#include <Columns/ColumnConst.h>
|
#include <Columns/ColumnConst.h>
|
||||||
|
|
||||||
#include <QueryPipeline/printPipeline.h>
|
|
||||||
|
|
||||||
namespace DB
|
namespace DB
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
1
|
14
tests/queries/0_stateless/03035_max_insert_threads_support.sh
Executable file
14
tests/queries/0_stateless/03035_max_insert_threads_support.sh
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
# shellcheck source=../shell_config.sh
|
||||||
|
. "$CURDIR"/../shell_config.sh
|
||||||
|
|
||||||
|
DATA_FILE="data_$CLICKHOUSE_TEST_UNIQUE_NAME.csv"
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT --max_insert_threads=4 --query="
|
||||||
|
EXPLAIN PIPELINE INSERT INTO FUNCTION file('$DATA_FILE') SELECT * FROM numbers_mt(1000000) ORDER BY number DESC
|
||||||
|
" | grep -o MaterializingTransform | wc -l
|
||||||
|
|
||||||
|
DATA_FILE_PATH=$($CLICKHOUSE_CLIENT_BINARY --query "select _path from file('$DATA_FILE', 'One')")
|
||||||
|
rm $DATA_FILE_PATH
|
Loading…
Reference in New Issue
Block a user