This commit is contained in:
Nikita Taranov 2023-02-04 21:54:48 +00:00
parent 750933d265
commit 1f1be6195e

View File

@ -1440,8 +1440,19 @@ Pipe ReadFromMergeTree::spreadMarkRanges(
column_names_to_read.erase(std::unique(column_names_to_read.begin(), column_names_to_read.end()), column_names_to_read.end()); column_names_to_read.erase(std::unique(column_names_to_read.begin(), column_names_to_read.end()), column_names_to_read.end());
} }
/// Construct a proper coordinator
if (input_order_info && is_parallel_reading_from_replicas && context->getClientInfo().interface == ClientInfo::Interface::LOCAL)
{
assert(context->parallel_reading_coordinator);
auto mode = input_order_info->direction == 1 ? CoordinationMode::WithOrder : CoordinationMode::ReverseOrder;
context->parallel_reading_coordinator->setMode(mode);
}
if (final) if (final)
{ {
if (is_parallel_reading_from_replicas)
throw Exception(ErrorCodes::LOGICAL_ERROR, "Final modifier is not supported with parallel replicas");
if (output_each_partition_through_separate_port) if (output_each_partition_through_separate_port)
throw Exception(ErrorCodes::LOGICAL_ERROR, "Optimisation isn't supposed to be used for queries with final"); throw Exception(ErrorCodes::LOGICAL_ERROR, "Optimisation isn't supposed to be used for queries with final");