1 | #include "StorageSystemContributors.h" |
---|---|
2 | |
3 | #include <algorithm> |
4 | #include <DataTypes/DataTypeString.h> |
5 | #include <Common/thread_local_rng.h> |
6 | |
7 | |
8 | extern const char * auto_contributors[]; |
9 | |
10 | namespace DB |
11 | { |
12 | NamesAndTypesList StorageSystemContributors::getNamesAndTypes() |
13 | { |
14 | return { |
15 | {"name", std::make_shared<DataTypeString>()}, |
16 | }; |
17 | } |
18 | |
19 | void StorageSystemContributors::fillData(MutableColumns & res_columns, const Context &, const SelectQueryInfo &) const |
20 | { |
21 | std::vector<const char *> contributors; |
22 | for (auto it = auto_contributors; *it; ++it) |
23 | contributors.emplace_back(*it); |
24 | |
25 | std::shuffle(contributors.begin(), contributors.end(), thread_local_rng); |
26 | |
27 | for (auto & it : contributors) |
28 | res_columns[0]->insert(String(it)); |
29 | } |
30 | } |
31 |