mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 19:02:04 +00:00
do not apply final on distributed engine, only on underlying
This commit is contained in:
parent
1cf8dc6daa
commit
7f8a4f8d87
@ -2917,11 +2917,11 @@ void InterpreterSelectQuery::ignoreWithTotals()
|
||||
bool InterpreterSelectQuery::forceSelectFinalOnSelectQuery(ASTSelectQuery & query)
|
||||
{
|
||||
// query.tables() is required because not all queries have tables in it, it could be a function.
|
||||
auto isFinalSupported = storage && storage->supportsFinal() && query.tables();
|
||||
auto isForceSelectFinalSettingOn = context->getSettingsRef().force_select_final;
|
||||
auto isQueryAlreadyFinal = query.final();
|
||||
auto is_force_select_final_setting_on = context->getSettingsRef().force_select_final;
|
||||
auto is_final_supported = storage && storage->supportsFinal() && !storage->isRemote() && query.tables();
|
||||
auto is_query_already_final = query.final();
|
||||
|
||||
return isForceSelectFinalSettingOn && !isQueryAlreadyFinal && isFinalSupported;
|
||||
return is_force_select_final_setting_on && !is_query_already_final && is_final_supported;
|
||||
}
|
||||
|
||||
void InterpreterSelectQuery::initSettings()
|
||||
|
Loading…
Reference in New Issue
Block a user