mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-29 05:00:47 +00:00
max_threads limit
This commit is contained in:
parent
2bd79325d7
commit
c5085b86aa
@ -1,3 +1,4 @@
|
||||
#include <algorithm>
|
||||
#include <Common/config.h>
|
||||
#include <Common/Exception.h>
|
||||
#include <Interpreters/Context.h>
|
||||
@ -124,7 +125,10 @@ BlockInputStreamPtr FormatFactory::getInput(
|
||||
row_input_format_params.max_execution_time = settings.max_execution_time;
|
||||
row_input_format_params.timeout_overflow_mode = settings.timeout_overflow_mode;
|
||||
|
||||
size_t max_threads_to_use = settings.max_threads_for_parallel_parsing;
|
||||
//The number of threads for parallel parsing must be less or equal settings.max_threads.
|
||||
const size_t global_max_threads = settings.max_threads;
|
||||
const size_t max_threads_for_parallel_parsing = settings.max_threads_for_parallel_parsing;
|
||||
const size_t max_threads_to_use = max_threads_for_parallel_parsing == 0 ? global_max_threads : std::min(max_threads_for_parallel_parsing, global_max_threads);
|
||||
|
||||
auto params = ParallelParsingBlockInputStream::InputCreatorParams{sample, context, row_input_format_params, format_settings};
|
||||
ParallelParsingBlockInputStream::Builder builder{buf, input_getter, params, file_segmentation_engine, max_threads_to_use, settings.min_chunk_size_for_parallel_parsing};
|
||||
|
Loading…
Reference in New Issue
Block a user