mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Small refactoring
This commit is contained in:
parent
c7c5b08948
commit
8b917d12f2
@ -56,21 +56,21 @@ struct WindowExpressionsCollectorMatcher
|
||||
if (func->is_window_function)
|
||||
return { .window_function_in_subtree = true };
|
||||
|
||||
bool window_function_in_subtree = false;
|
||||
WindowExpressionsCollectorChildInfo result;
|
||||
for (auto & arg : func->arguments->children)
|
||||
{
|
||||
auto subtree_result = visitNode(arg, ast);
|
||||
window_function_in_subtree = window_function_in_subtree || subtree_result.window_function_in_subtree;
|
||||
result.update(subtree_result);
|
||||
}
|
||||
|
||||
// We mark functions only on the top of AST
|
||||
if ((!parent || !parent->as<ASTFunction>()) && window_function_in_subtree)
|
||||
if ((!parent || !parent->as<ASTFunction>()) && result.window_function_in_subtree)
|
||||
{
|
||||
expressions_with_window_functions.push_back(func);
|
||||
func->compute_after_window_functions = true;
|
||||
}
|
||||
|
||||
return { .window_function_in_subtree = window_function_in_subtree };
|
||||
return result;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user