mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +00:00
Merge pull request #64678 from ClickHouse/backport/24.3/64638
Backport #64638 to 24.3: Analyzer: Fix RewriteAggregateFunctionWithIfPass
This commit is contained in:
commit
e043937507
@ -36,6 +36,10 @@ public:
|
||||
if (!function_node || !function_node->isAggregateFunction())
|
||||
return;
|
||||
|
||||
auto lower_name = Poco::toLower(function_node->getFunctionName());
|
||||
if (lower_name.ends_with("if"))
|
||||
return;
|
||||
|
||||
auto & function_arguments_nodes = function_node->getArguments().getNodes();
|
||||
if (function_arguments_nodes.size() != 1)
|
||||
return;
|
||||
@ -44,7 +48,6 @@ public:
|
||||
if (!if_node || if_node->getFunctionName() != "if")
|
||||
return;
|
||||
|
||||
auto lower_name = Poco::toLower(function_node->getFunctionName());
|
||||
auto if_arguments_nodes = if_node->getArguments().getNodes();
|
||||
auto * first_const_node = if_arguments_nodes[1]->as<ConstantNode>();
|
||||
auto * second_const_node = if_arguments_nodes[2]->as<ConstantNode>();
|
||||
|
@ -0,0 +1 @@
|
||||
1
|
@ -0,0 +1 @@
|
||||
SELECT countIf(multiIf(number < 2, NULL, if(number = 4, 1, 0))) FROM numbers(5);
|
Loading…
Reference in New Issue
Block a user