2018-10-26 17:43:50 +00:00
|
|
|
#include "StorageSystemContributors.h"
|
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
#include <DataTypes/DataTypeString.h>
|
2019-07-28 15:30:38 +00:00
|
|
|
#include <Common/thread_local_rng.h>
|
2018-10-26 17:43:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
extern const char * auto_contributors[];
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
NamesAndTypesList StorageSystemContributors::getNamesAndTypes()
|
|
|
|
{
|
|
|
|
return {
|
|
|
|
{"name", std::make_shared<DataTypeString>()},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-04-10 23:33:54 +00:00
|
|
|
void StorageSystemContributors::fillData(MutableColumns & res_columns, ContextPtr, const SelectQueryInfo &) const
|
2018-10-26 17:43:50 +00:00
|
|
|
{
|
|
|
|
std::vector<const char *> contributors;
|
2020-04-22 07:03:43 +00:00
|
|
|
for (auto * it = auto_contributors; *it; ++it)
|
2018-10-26 17:43:50 +00:00
|
|
|
contributors.emplace_back(*it);
|
|
|
|
|
2019-07-28 15:30:38 +00:00
|
|
|
std::shuffle(contributors.begin(), contributors.end(), thread_local_rng);
|
2018-10-26 17:43:50 +00:00
|
|
|
|
|
|
|
for (auto & it : contributors)
|
|
|
|
res_columns[0]->insert(String(it));
|
|
|
|
}
|
|
|
|
}
|