beautify and change max_value

This commit is contained in:
Yarik Briukhovetskyi 2024-03-12 16:39:10 +01:00 committed by GitHub
parent 01d0fba085
commit 858ad2d688
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2553,10 +2553,10 @@ void InterpreterSelectQuery::executeFetchColumns(QueryProcessingStage::Enum proc
/// If necessary, we request more sources than the number of threads - to distribute the work evenly over the threads.
if (max_streams > 1 && !is_sync_remote)
{
if (auto streams_with_ratio = max_streams * settings.max_streams_to_max_threads_ratio; streams_with_ratio > sizeof(size_t))
if (auto streams_with_ratio = max_streams * settings.max_streams_to_max_threads_ratio; streams_with_ratio < SIZE_MAX)
max_streams = static_cast<size_t>(streams_with_ratio);
else
throw Exception(ErrorCodes::INCORRECT_DATA, "Exceeded limit for `max_streams_to_max_threads_ratio`. Make sure that `max_streams * max_streams_to_max_threads_ratio` not exceeds {}, current value: {}", sizeof(size_t), streams_with_ratio);
throw Exception(ErrorCodes::PARAMETER_OUT_OF_BOUND, "Exceeded limit for `max_streams` with `max_streams_to_max_threads_ratio`. Make sure that `max_streams * max_streams_to_max_threads_ratio` not exceeds {}, current value: {}", SIZE_MAX, streams_with_ratio);
}
auto & prewhere_info = analysis_result.prewhere_info;