mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 20:12:02 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
31 lines
755 B
C++
31 lines
755 B
C++
#include "StorageSystemContributors.h"
|
|
|
|
#include <algorithm>
|
|
#include <DataTypes/DataTypeString.h>
|
|
#include <Common/thread_local_rng.h>
|
|
|
|
|
|
extern const char * auto_contributors[];
|
|
|
|
namespace DB
|
|
{
|
|
NamesAndTypesList StorageSystemContributors::getNamesAndTypes()
|
|
{
|
|
return {
|
|
{"name", std::make_shared<DataTypeString>()},
|
|
};
|
|
}
|
|
|
|
void StorageSystemContributors::fillData(MutableColumns & res_columns, const Context &, const SelectQueryInfo &) const
|
|
{
|
|
std::vector<const char *> contributors;
|
|
for (auto it = auto_contributors; *it; ++it)
|
|
contributors.emplace_back(*it);
|
|
|
|
std::shuffle(contributors.begin(), contributors.end(), thread_local_rng);
|
|
|
|
for (auto & it : contributors)
|
|
res_columns[0]->insert(String(it));
|
|
}
|
|
}
|