mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 09:10:48 +00:00
fix align of data && add test
This commit is contained in:
parent
7135b8491c
commit
f206d74b63
@ -30,10 +30,7 @@ struct AggregateFunctionDistinctData
|
||||
|
||||
bool ALWAYS_INLINE tryToInsert(const Key& key)
|
||||
{
|
||||
std::lock_guard lock(mutex);
|
||||
bool a = set.insert(key).second;
|
||||
if (a) std::cerr << key.high << ' ' << key.low << ' ' << a << std::endl;
|
||||
return a;
|
||||
return set.insert(key).second;
|
||||
}
|
||||
};
|
||||
|
||||
@ -63,7 +60,7 @@ public:
|
||||
: IAggregateFunctionDataHelper<AggregateFunctionDistinctData, AggregateFunctionDistinct>(arguments, {})
|
||||
, nested_func(nested), num_arguments(arguments.size())
|
||||
{
|
||||
prefix_size = 640'000'000;
|
||||
prefix_size = sizeof(AggregateFunctionDistinctData);
|
||||
|
||||
if (arguments.empty())
|
||||
throw Exception("Aggregate function " + getName() + " require at least one argument", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
|
||||
|
@ -1,4 +1,5 @@
|
||||
499500
|
||||
78
|
||||
[0,1,2,3,4,5,6,7,8,9,10,11,12]
|
||||
[0,1,2,3,4,5,6,7,8,9,10,11,12]
|
||||
5.669227916063075e-17
|
||||
|
@ -1,4 +1,5 @@
|
||||
SELECT sum(DISTINCT x) FROM (SELECT number AS x FROM system.numbers LIMIT 1000);
|
||||
SELECT sum(DISTINCT x) FROM (SELECT number % 13 AS x FROM system.numbers LIMIT 1000);
|
||||
SELECT groupArray(DISTINCT x) FROM (SELECT number % 13 AS x FROM system.numbers LIMIT 1000);
|
||||
SELECT groupArray(DISTINCT x) FROM (SELECT number % 13 AS x FROM system.numbers_mt LIMIT 1000);
|
||||
SELECT corrStableDistinct(DISTINCT x, y) FROM (SELECT number % 11 AS x, number % 13 AS y FROM system.numbers LIMIT 1000);
|
Loading…
Reference in New Issue
Block a user