mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 07:01:59 +00:00
Fix errors
This commit is contained in:
parent
c378710f6b
commit
a1ce6c4165
@ -96,6 +96,11 @@ public:
|
||||
|
||||
if constexpr (overflow)
|
||||
{
|
||||
if (value_type->onlyNull())
|
||||
throw Exception{ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT,
|
||||
"Cannot calculate {} of type {}",
|
||||
getName(), value_type->getName()};
|
||||
|
||||
// Overflow, meaning that the returned type is the same as
|
||||
// the input type. Nulls are skipped.
|
||||
result_type = removeNullable(value_type);
|
||||
@ -190,11 +195,8 @@ public:
|
||||
{
|
||||
// Create a value array for this key
|
||||
Array new_values;
|
||||
new_values.resize(values_types.size());
|
||||
for (size_t k = 0; k < new_values.size(); ++k)
|
||||
{
|
||||
new_values[k] = (k == col) ? value : values_types[k]->getDefault();
|
||||
}
|
||||
new_values.resize(size);
|
||||
new_values[col] = value;
|
||||
|
||||
if constexpr (IsDecimalNumber<T>)
|
||||
{
|
||||
|
@ -1,7 +1,4 @@
|
||||
([],[])
|
||||
([],[])
|
||||
([],[])
|
||||
([2],[11])
|
||||
([2],[22])
|
||||
([1,2],[0,11])
|
||||
([1,2],[0,22])
|
||||
([2],[33])
|
||||
([2],[33])
|
||||
|
@ -1,7 +1,7 @@
|
||||
select minMap(arrayJoin([([1], [null]), ([1], [null])]));
|
||||
select maxMap(arrayJoin([([1], [null]), ([1], [null])]));
|
||||
select minMap(arrayJoin([([1], [null]), ([1], [null])])); -- { serverError 43 }
|
||||
select maxMap(arrayJoin([([1], [null]), ([1], [null])])); -- { serverError 43 }
|
||||
select sumMap(arrayJoin([([1], [null]), ([1], [null])])); -- { serverError 43 }
|
||||
select sumMapWithOverflow(arrayJoin([([1], [null]), ([1], [null])]));
|
||||
select sumMapWithOverflow(arrayJoin([([1], [null]), ([1], [null])])); -- { serverError 43 }
|
||||
|
||||
select minMap(arrayJoin([([1, 2], [null, 11]), ([1, 2], [null, 22])]));
|
||||
select maxMap(arrayJoin([([1, 2], [null, 11]), ([1, 2], [null, 22])]));
|
||||
|
@ -0,0 +1 @@
|
||||
([1,2],[1,2],[1,0])
|
5
tests/queries/0_stateless/01621_summap_check_types.sql
Normal file
5
tests/queries/0_stateless/01621_summap_check_types.sql
Normal file
@ -0,0 +1,5 @@
|
||||
select initializeAggregation('sumMap', [1, 2], [1, 2], [1, null]);
|
||||
|
||||
CREATE TEMPORARY TABLE sum_map_overflow (events Array(UInt8), counts Array(UInt8));
|
||||
INSERT INTO sum_map_overflow VALUES ([1], [255]), ([1], [2]);
|
||||
SELECT [NULL], sumMapWithOverflow(events, [NULL], [[(NULL)]], counts) FROM sum_map_overflow; -- { serverError 43 }
|
Loading…
Reference in New Issue
Block a user