mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Run query on 1 replica if no custom_key
This commit is contained in:
parent
7df545fbe3
commit
ffa3d1d603
@ -511,7 +511,7 @@ InterpreterSelectQuery::InterpreterSelectQuery(
|
||||
settings.additional_table_filters, joined_tables.tablesWithColumns().front().table, *context);
|
||||
|
||||
ASTPtr parallel_replicas_custom_filter_ast = nullptr;
|
||||
if (settings.parallel_replicas_count > 1 && settings.parallel_replicas_mode == ParallelReplicasMode::CUSTOM_KEY)
|
||||
if (settings.parallel_replicas_count > 1 && settings.parallel_replicas_mode == ParallelReplicasMode::CUSTOM_KEY && !joined_tables.tablesWithColumns().empty())
|
||||
{
|
||||
if (auto custom_key_ast = parseCustomKeyForTable(settings.parallel_replicas_custom_key, joined_tables.tablesWithColumns().front().table, *context))
|
||||
{
|
||||
@ -527,6 +527,14 @@ InterpreterSelectQuery::InterpreterSelectQuery(
|
||||
*storage,
|
||||
context);
|
||||
}
|
||||
else if (settings.parallel_replica_offset > 0)
|
||||
{
|
||||
LOG_DEBUG(
|
||||
log,
|
||||
"Will use no data on this replica because parallel replicas processing with custom_key has been requested"
|
||||
" (setting 'max_parallel_replicas') but the table does not have custom_key defined for it (settings `parallel_replicas_custom_key`)");
|
||||
parallel_replicas_custom_filter_ast = std::make_shared<ASTLiteral>(false);
|
||||
}
|
||||
}
|
||||
|
||||
auto analyze = [&](bool try_move_to_prewhere)
|
||||
|
Loading…
Reference in New Issue
Block a user