random seed by default

This commit is contained in:
Amos Bird 2020-03-18 16:12:15 +08:00
parent 48a2b46499
commit 045f5ae348
No known key found for this signature in database
GPG Key ID: 80D430DCBECFEDB4
2 changed files with 2 additions and 2 deletions

View File

@ -88,7 +88,7 @@ AggregateFunctionPtr createAggregateFunctionGroupArraySample(const std::string &
assertUnary(name, argument_types);
UInt64 max_elems = std::numeric_limits<UInt64>::max();
UInt64 seed = 123456;
UInt64 seed = thread_local_rng();
UInt64 * params[2] = {&max_elems, &seed};
if (parameters.size() != 1 && parameters.size() != 2)

View File

@ -1,4 +1,4 @@
select k, groupArraySample(10)(v) from (select number % 4 as k, number as v from numbers(1024)) group by k;
select k, groupArraySample(10, 123456)(v) from (select number % 4 as k, number as v from numbers(1024)) group by k;
-- different seed
select k, groupArraySample(10, 1)(v) from (select number % 4 as k, number as v from numbers(1024)) group by k;