mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
Merge pull request #57795 from CurtizJ/fix-totals-maxMap
Fix merge in aggregation functions with `*Map` combinator
This commit is contained in:
commit
c2f32f5994
@ -254,11 +254,20 @@ public:
|
||||
if (it != merged_maps.end())
|
||||
{
|
||||
for (size_t col = 0; col < values_types.size(); ++col)
|
||||
{
|
||||
if (!elem.second[col].isNull())
|
||||
applyVisitor(Visitor(elem.second[col]), it->second[col]);
|
||||
{
|
||||
if (it->second[col].isNull())
|
||||
it->second[col] = elem.second[col];
|
||||
else
|
||||
applyVisitor(Visitor(elem.second[col]), it->second[col]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
merged_maps[elem.first] = elem.second;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,119 +1,119 @@
|
||||
([-1,0],[0,0])
|
||||
([1,2],[0,2])
|
||||
([0,1],[0,1])
|
||||
([1,2],[0,2])
|
||||
|
||||
([-1,0,1,2],[0,0,0,2])
|
||||
([-1,0,1,2],[0,0,1,2])
|
||||
([-1,0],[0,0])
|
||||
([1,2],[0,2])
|
||||
([-1,0,1,2],[0,0,1,2])
|
||||
([0,1],[0,1])
|
||||
([-1,0,1,2],[0,0,0,2])
|
||||
([1,2],[0,2])
|
||||
([-1,0],[0,0])
|
||||
([1,2],[0,2])
|
||||
([-1,0,1,2],[0,0,1,2])
|
||||
([0,1],[0,1])
|
||||
([-1,0,1,2],[0,0,0,2])
|
||||
([1,2],[0,2])
|
||||
([-1,0],[0,0])
|
||||
([1,2],[0,2])
|
||||
([0,1],[0,1])
|
||||
([1,2],[0,2])
|
||||
|
||||
([-1,0,1,2],[0,0,0,2])
|
||||
([-1,0,1,2],[0,0,1,2])
|
||||
([-1,0],[0,0])
|
||||
([1,2],[0,2])
|
||||
([-1,0,1,2],[0,0,1,2])
|
||||
([0,1],[0,1])
|
||||
([-1,0,1,2],[0,0,0,2])
|
||||
([1,2],[0,2])
|
||||
([-1,0],[0,0])
|
||||
([1,2],[0,2])
|
||||
([-1,0,1,2],[0,0,1,2])
|
||||
([0,1],[0,1])
|
||||
([-1,0,1,2],[0,0,0,2])
|
||||
([1,2],[0,2])
|
||||
([0],[0])
|
||||
([2],[2])
|
||||
([1],[1])
|
||||
([2],[2])
|
||||
|
||||
([0,2],[0,2])
|
||||
([0,1,2],[0,1,2])
|
||||
([0],[0])
|
||||
([2],[2])
|
||||
([0,1,2],[0,1,2])
|
||||
([1],[1])
|
||||
([0,2],[0,2])
|
||||
([2],[2])
|
||||
([0],[0])
|
||||
([2],[2])
|
||||
([0,1,2],[0,1,2])
|
||||
([1],[1])
|
||||
([0,2],[0,2])
|
||||
([2],[2])
|
||||
-
|
||||
([-1,0],[0,0])
|
||||
([1,2],[0,2])
|
||||
([0,1],[0,1])
|
||||
([1,2],[0,2])
|
||||
|
||||
([-1,0,1,2],[0,0,0,2])
|
||||
([-1,0,1,2],[0,0,1,2])
|
||||
([-1,0],[0,0])
|
||||
([1,2],[0,2])
|
||||
([-1,0,1,2],[0,0,1,2])
|
||||
([0,1],[0,1])
|
||||
([-1,0,1,2],[0,0,0,2])
|
||||
([1,2],[0,2])
|
||||
([-1,0],[0,0])
|
||||
([1,2],[0,2])
|
||||
([-1,0,1,2],[0,0,1,2])
|
||||
([0,1],[0,1])
|
||||
([-1,0,1,2],[0,0,0,2])
|
||||
([1,2],[0,2])
|
||||
([-1,0],[0,0])
|
||||
([1,2],[0,2])
|
||||
([0,1],[0,1])
|
||||
([1,2],[0,2])
|
||||
|
||||
([-1,0,1,2],[0,0,0,2])
|
||||
([-1,0,1,2],[0,0,1,2])
|
||||
([-1,0],[0,0])
|
||||
([1,2],[0,2])
|
||||
([-1,0,1,2],[0,0,1,2])
|
||||
([0,1],[0,1])
|
||||
([-1,0,1,2],[0,0,0,2])
|
||||
([1,2],[0,2])
|
||||
([-1,0],[0,0])
|
||||
([1,2],[0,2])
|
||||
([-1,0,1,2],[0,0,1,2])
|
||||
([0,1],[0,1])
|
||||
([-1,0,1,2],[0,0,0,2])
|
||||
([1,2],[0,2])
|
||||
([0],[0])
|
||||
([2],[2])
|
||||
([1],[1])
|
||||
([2],[2])
|
||||
|
||||
([0,2],[0,2])
|
||||
([0,1,2],[0,1,2])
|
||||
([0],[0])
|
||||
([2],[2])
|
||||
([0,1,2],[0,1,2])
|
||||
([1],[1])
|
||||
([0,2],[0,2])
|
||||
([2],[2])
|
||||
([0],[0])
|
||||
([2],[2])
|
||||
([0,1,2],[0,1,2])
|
||||
([1],[1])
|
||||
([0,2],[0,2])
|
||||
([2],[2])
|
||||
-
|
||||
([-1,0],[0,0])
|
||||
([1,2],[0,2])
|
||||
([0,1],[0,1])
|
||||
([1,2],[0,2])
|
||||
|
||||
([-1,0,1,2],[0,0,0,2])
|
||||
([-1,0,1,2],[0,0,1,2])
|
||||
([-1,0],[0,0])
|
||||
([1,2],[0,2])
|
||||
([-1,0,1,2],[0,0,1,2])
|
||||
([0,1],[0,1])
|
||||
([-1,0,1,2],[0,0,0,2])
|
||||
([1,2],[0,2])
|
||||
([-1,0],[0,0])
|
||||
([1,2],[0,2])
|
||||
([-1,0,1,2],[0,0,1,2])
|
||||
([0,1],[0,1])
|
||||
([-1,0,1,2],[0,0,0,2])
|
||||
([1,2],[0,2])
|
||||
([-1,0],[0,0])
|
||||
([1,2],[0,2])
|
||||
([0,1],[0,1])
|
||||
([1,2],[0,2])
|
||||
|
||||
([-1,0,1,2],[0,0,0,2])
|
||||
([-1,0,1,2],[0,0,1,2])
|
||||
([-1,0],[0,0])
|
||||
([1,2],[0,2])
|
||||
([-1,0,1,2],[0,0,1,2])
|
||||
([0,1],[0,1])
|
||||
([-1,0,1,2],[0,0,0,2])
|
||||
([1,2],[0,2])
|
||||
([-1,0],[0,0])
|
||||
([1,2],[0,2])
|
||||
([-1,0,1,2],[0,0,1,2])
|
||||
([0,1],[0,1])
|
||||
([-1,0,1,2],[0,0,0,2])
|
||||
([1,2],[0,2])
|
||||
([0],[0])
|
||||
([2],[2])
|
||||
([1],[1])
|
||||
([2],[2])
|
||||
|
||||
([0,2],[0,2])
|
||||
([0,1,2],[0,1,2])
|
||||
([0],[0])
|
||||
([2],[2])
|
||||
([0,1,2],[0,1,2])
|
||||
([1],[1])
|
||||
([0,2],[0,2])
|
||||
([2],[2])
|
||||
([0],[0])
|
||||
([2],[2])
|
||||
([0,1,2],[0,1,2])
|
||||
([1],[1])
|
||||
([0,2],[0,2])
|
||||
([2],[2])
|
||||
|
@ -1,39 +1,39 @@
|
||||
SELECT maxMap([number % 3, number % 4 - 1], [number, NULL]) FROM numbers(3) GROUP BY number WITH TOTALS;
|
||||
SELECT maxMap([number % 3, number % 4 - 1], [number, NULL]) FROM numbers(3) GROUP BY number WITH ROLLUP;
|
||||
SELECT maxMap([number % 3, number % 4 - 1], [number, NULL]) FROM numbers(3) GROUP BY number WITH CUBE;
|
||||
SELECT maxMap([number % 3, number % 4 - 1], [number, NULL]) FROM numbers(3) GROUP BY number WITH TOTALS ORDER BY number;
|
||||
SELECT maxMap([number % 3, number % 4 - 1], [number, NULL]) FROM numbers(3) GROUP BY number WITH ROLLUP ORDER BY number;
|
||||
SELECT maxMap([number % 3, number % 4 - 1], [number, NULL]) FROM numbers(3) GROUP BY number WITH CUBE ORDER BY number;
|
||||
|
||||
SELECT minMap([number % 3, number % 4 - 1], [number, NULL]) FROM numbers(3) GROUP BY number WITH TOTALS;
|
||||
SELECT minMap([number % 3, number % 4 - 1], [number, NULL]) FROM numbers(3) GROUP BY number WITH ROLLUP;
|
||||
SELECT minMap([number % 3, number % 4 - 1], [number, NULL]) FROM numbers(3) GROUP BY number WITH CUBE;
|
||||
SELECT minMap([number % 3, number % 4 - 1], [number, NULL]) FROM numbers(3) GROUP BY number WITH TOTALS ORDER BY number;
|
||||
SELECT minMap([number % 3, number % 4 - 1], [number, NULL]) FROM numbers(3) GROUP BY number WITH ROLLUP ORDER BY number;
|
||||
SELECT minMap([number % 3, number % 4 - 1], [number, NULL]) FROM numbers(3) GROUP BY number WITH CUBE ORDER BY number;
|
||||
|
||||
SELECT sumMap([number % 3, number % 4 - 1], [number, NULL]) FROM numbers(3) GROUP BY number WITH TOTALS;
|
||||
SELECT sumMap([number % 3, number % 4 - 1], [number, NULL]) FROM numbers(3) GROUP BY number WITH ROLLUP;
|
||||
SELECT sumMap([number % 3, number % 4 - 1], [number, NULL]) FROM numbers(3) GROUP BY number WITH CUBE;
|
||||
SELECT sumMap([number % 3, number % 4 - 1], [number, NULL]) FROM numbers(3) GROUP BY number WITH TOTALS ORDER BY number;
|
||||
SELECT sumMap([number % 3, number % 4 - 1], [number, NULL]) FROM numbers(3) GROUP BY number WITH ROLLUP ORDER BY number;
|
||||
SELECT sumMap([number % 3, number % 4 - 1], [number, NULL]) FROM numbers(3) GROUP BY number WITH CUBE ORDER BY number;
|
||||
|
||||
SELECT '-';
|
||||
|
||||
SELECT maxMap([number % 3, number % 4 - 1], [number :: Float64, NULL]) FROM numbers(3) GROUP BY number WITH TOTALS;
|
||||
SELECT maxMap([number % 3, number % 4 - 1], [number :: Float64, NULL]) FROM numbers(3) GROUP BY number WITH ROLLUP;
|
||||
SELECT maxMap([number % 3, number % 4 - 1], [number :: Float64, NULL]) FROM numbers(3) GROUP BY number WITH CUBE;
|
||||
SELECT maxMap([number % 3, number % 4 - 1], [number :: Float64, NULL]) FROM numbers(3) GROUP BY number WITH TOTALS ORDER BY number;
|
||||
SELECT maxMap([number % 3, number % 4 - 1], [number :: Float64, NULL]) FROM numbers(3) GROUP BY number WITH ROLLUP ORDER BY number;
|
||||
SELECT maxMap([number % 3, number % 4 - 1], [number :: Float64, NULL]) FROM numbers(3) GROUP BY number WITH CUBE ORDER BY number;
|
||||
|
||||
SELECT minMap([number % 3, number % 4 - 1], [number :: Float64, NULL]) FROM numbers(3) GROUP BY number WITH TOTALS;
|
||||
SELECT minMap([number % 3, number % 4 - 1], [number :: Float64, NULL]) FROM numbers(3) GROUP BY number WITH ROLLUP;
|
||||
SELECT minMap([number % 3, number % 4 - 1], [number :: Float64, NULL]) FROM numbers(3) GROUP BY number WITH CUBE;
|
||||
SELECT minMap([number % 3, number % 4 - 1], [number :: Float64, NULL]) FROM numbers(3) GROUP BY number WITH TOTALS ORDER BY number;
|
||||
SELECT minMap([number % 3, number % 4 - 1], [number :: Float64, NULL]) FROM numbers(3) GROUP BY number WITH ROLLUP ORDER BY number;
|
||||
SELECT minMap([number % 3, number % 4 - 1], [number :: Float64, NULL]) FROM numbers(3) GROUP BY number WITH CUBE ORDER BY number;
|
||||
|
||||
SELECT sumMap([number % 3, number % 4 - 1], [number :: Float64, NULL]) FROM numbers(3) GROUP BY number WITH TOTALS;
|
||||
SELECT sumMap([number % 3, number % 4 - 1], [number :: Float64, NULL]) FROM numbers(3) GROUP BY number WITH ROLLUP;
|
||||
SELECT sumMap([number % 3, number % 4 - 1], [number :: Float64, NULL]) FROM numbers(3) GROUP BY number WITH CUBE;
|
||||
SELECT sumMap([number % 3, number % 4 - 1], [number :: Float64, NULL]) FROM numbers(3) GROUP BY number WITH TOTALS ORDER BY number;
|
||||
SELECT sumMap([number % 3, number % 4 - 1], [number :: Float64, NULL]) FROM numbers(3) GROUP BY number WITH ROLLUP ORDER BY number;
|
||||
SELECT sumMap([number % 3, number % 4 - 1], [number :: Float64, NULL]) FROM numbers(3) GROUP BY number WITH CUBE ORDER BY number;
|
||||
|
||||
SELECT '-';
|
||||
|
||||
SELECT maxMap([number % 3, number % 4 - 1], [number :: UInt256, NULL]) FROM numbers(3) GROUP BY number WITH TOTALS;
|
||||
SELECT maxMap([number % 3, number % 4 - 1], [number :: UInt256, NULL]) FROM numbers(3) GROUP BY number WITH ROLLUP;
|
||||
SELECT maxMap([number % 3, number % 4 - 1], [number :: UInt256, NULL]) FROM numbers(3) GROUP BY number WITH CUBE;
|
||||
SELECT maxMap([number % 3, number % 4 - 1], [number :: UInt256, NULL]) FROM numbers(3) GROUP BY number WITH TOTALS ORDER BY number;
|
||||
SELECT maxMap([number % 3, number % 4 - 1], [number :: UInt256, NULL]) FROM numbers(3) GROUP BY number WITH ROLLUP ORDER BY number;
|
||||
SELECT maxMap([number % 3, number % 4 - 1], [number :: UInt256, NULL]) FROM numbers(3) GROUP BY number WITH CUBE ORDER BY number;
|
||||
|
||||
SELECT minMap([number % 3, number % 4 - 1], [number :: UInt256, NULL]) FROM numbers(3) GROUP BY number WITH TOTALS;
|
||||
SELECT minMap([number % 3, number % 4 - 1], [number :: UInt256, NULL]) FROM numbers(3) GROUP BY number WITH ROLLUP;
|
||||
SELECT minMap([number % 3, number % 4 - 1], [number :: UInt256, NULL]) FROM numbers(3) GROUP BY number WITH CUBE;
|
||||
SELECT minMap([number % 3, number % 4 - 1], [number :: UInt256, NULL]) FROM numbers(3) GROUP BY number WITH TOTALS ORDER BY number;
|
||||
SELECT minMap([number % 3, number % 4 - 1], [number :: UInt256, NULL]) FROM numbers(3) GROUP BY number WITH ROLLUP ORDER BY number;
|
||||
SELECT minMap([number % 3, number % 4 - 1], [number :: UInt256, NULL]) FROM numbers(3) GROUP BY number WITH CUBE ORDER BY number;
|
||||
|
||||
SELECT sumMap([number % 3, number % 4 - 1], [number :: UInt256, NULL]) FROM numbers(3) GROUP BY number WITH TOTALS;
|
||||
SELECT sumMap([number % 3, number % 4 - 1], [number :: UInt256, NULL]) FROM numbers(3) GROUP BY number WITH ROLLUP;
|
||||
SELECT sumMap([number % 3, number % 4 - 1], [number :: UInt256, NULL]) FROM numbers(3) GROUP BY number WITH CUBE;
|
||||
SELECT sumMap([number % 3, number % 4 - 1], [number :: UInt256, NULL]) FROM numbers(3) GROUP BY number WITH TOTALS ORDER BY number;
|
||||
SELECT sumMap([number % 3, number % 4 - 1], [number :: UInt256, NULL]) FROM numbers(3) GROUP BY number WITH ROLLUP ORDER BY number;
|
||||
SELECT sumMap([number % 3, number % 4 - 1], [number :: UInt256, NULL]) FROM numbers(3) GROUP BY number WITH CUBE ORDER BY number;
|
Loading…
Reference in New Issue
Block a user