mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 20:32:43 +00:00
Merge pull request #66228 from ClickHouse/backport/24.6/66146
Backport #66146 to 24.6: Fix issue in SumIfToCountIfVisitor and signed integers
This commit is contained in:
commit
d1a517d0bb
@ -32,7 +32,7 @@ public:
|
||||
return;
|
||||
|
||||
auto * function_node = node->as<FunctionNode>();
|
||||
if (!function_node || !function_node->isAggregateFunction())
|
||||
if (!function_node || !function_node->isAggregateFunction() || !function_node->getResultType()->equals(DataTypeUInt64()))
|
||||
return;
|
||||
|
||||
auto function_name = function_node->getFunctionName();
|
||||
|
@ -0,0 +1,24 @@
|
||||
QUERY id: 0
|
||||
PROJECTION COLUMNS
|
||||
(sumIf(toInt64(1), 1)) Tuple(Int64)
|
||||
PROJECTION
|
||||
LIST id: 1, nodes: 1
|
||||
FUNCTION id: 2, function_name: tuple, function_type: ordinary, result_type: Tuple(Int64)
|
||||
ARGUMENTS
|
||||
LIST id: 3, nodes: 1
|
||||
FUNCTION id: 4, function_name: sumIf, function_type: aggregate, result_type: Int64
|
||||
ARGUMENTS
|
||||
LIST id: 5, nodes: 2
|
||||
CONSTANT id: 6, constant_value: Int64_1, constant_value_type: Int64
|
||||
EXPRESSION
|
||||
FUNCTION id: 7, function_name: toInt64, function_type: ordinary, result_type: Int64
|
||||
ARGUMENTS
|
||||
LIST id: 8, nodes: 1
|
||||
CONSTANT id: 9, constant_value: UInt64_1, constant_value_type: UInt8
|
||||
CONSTANT id: 10, constant_value: UInt64_1, constant_value_type: UInt8
|
||||
JOIN TREE
|
||||
TABLE_FUNCTION id: 11, alias: __table1, table_function_name: numbers
|
||||
ARGUMENTS
|
||||
LIST id: 12, nodes: 1
|
||||
CONSTANT id: 13, constant_value: UInt64_100, constant_value_type: UInt8
|
||||
SETTINGS optimize_rewrite_sum_if_to_count_if=1
|
@ -0,0 +1,2 @@
|
||||
SET allow_experimental_analyzer = 1;
|
||||
EXPLAIN QUERY TREE SELECT tuple(sumIf(toInt64(1), 1)) FROM numbers(100) settings optimize_rewrite_sum_if_to_count_if=1;
|
Loading…
Reference in New Issue
Block a user