2018-08-10 17:42:12 +00:00
|
|
|
#include <DataTypes/DataTypeString.h>
|
|
|
|
#include <DataTypes/DataTypesNumber.h>
|
|
|
|
#include <Interpreters/Context.h>
|
|
|
|
#include <Storages/System/StorageSystemMergeTreeSettings.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2020-08-23 12:38:52 +00:00
|
|
|
template <bool replicated>
|
|
|
|
NamesAndTypesList SystemMergeTreeSettings<replicated>::getNamesAndTypes()
|
2018-08-10 17:42:12 +00:00
|
|
|
{
|
|
|
|
return {
|
2019-04-26 16:10:37 +00:00
|
|
|
{"name", std::make_shared<DataTypeString>()},
|
|
|
|
{"value", std::make_shared<DataTypeString>()},
|
|
|
|
{"changed", std::make_shared<DataTypeUInt8>()},
|
|
|
|
{"description", std::make_shared<DataTypeString>()},
|
2020-03-28 08:11:49 +00:00
|
|
|
{"type", std::make_shared<DataTypeString>()},
|
2018-08-10 17:42:12 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-08-23 12:38:52 +00:00
|
|
|
template <bool replicated>
|
2021-04-10 23:33:54 +00:00
|
|
|
void SystemMergeTreeSettings<replicated>::fillData(MutableColumns & res_columns, ContextPtr context, const SelectQueryInfo &) const
|
2018-08-10 17:42:12 +00:00
|
|
|
{
|
2021-04-10 23:33:54 +00:00
|
|
|
const auto & settings = replicated ? context->getReplicatedMergeTreeSettings().all() : context->getMergeTreeSettings().all();
|
2020-08-23 12:38:52 +00:00
|
|
|
for (const auto & setting : settings)
|
2019-04-25 14:08:20 +00:00
|
|
|
{
|
2020-07-20 09:57:17 +00:00
|
|
|
res_columns[0]->insert(setting.getName());
|
|
|
|
res_columns[1]->insert(setting.getValueString());
|
|
|
|
res_columns[2]->insert(setting.isValueChanged());
|
|
|
|
res_columns[3]->insert(setting.getDescription());
|
|
|
|
res_columns[4]->insert(setting.getTypeName());
|
2019-04-25 14:08:20 +00:00
|
|
|
}
|
2018-08-10 17:42:12 +00:00
|
|
|
}
|
|
|
|
|
2020-08-23 12:38:52 +00:00
|
|
|
template class SystemMergeTreeSettings<false>;
|
|
|
|
template class SystemMergeTreeSettings<true>;
|
2018-08-10 17:42:12 +00:00
|
|
|
}
|