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
|
|
|
|
{
|
|
|
|
|
|
|
|
NamesAndTypesList SystemMergeTreeSettings::getNamesAndTypes()
|
|
|
|
{
|
|
|
|
return {
|
|
|
|
{"name", std::make_shared<DataTypeString>()},
|
|
|
|
{"value", std::make_shared<DataTypeString>()},
|
|
|
|
{"changed", std::make_shared<DataTypeUInt8>()},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
void SystemMergeTreeSettings::fillData(MutableColumns & res_columns, const Context & context, const SelectQueryInfo &) const
|
|
|
|
{
|
|
|
|
const MergeTreeSettings & settings = context.getMergeTreeSettings();
|
|
|
|
|
2019-04-18 22:18:50 +00:00
|
|
|
#define ADD_SETTING(TYPE, NAME, DEFAULT, DESCRIPTION) \
|
2018-10-22 08:54:54 +00:00
|
|
|
res_columns[0]->insert(#NAME); \
|
2018-08-10 17:42:12 +00:00
|
|
|
res_columns[1]->insert(settings.NAME.toString()); \
|
2018-10-22 08:54:54 +00:00
|
|
|
res_columns[2]->insert(settings.NAME.changed);
|
2018-08-10 17:42:12 +00:00
|
|
|
APPLY_FOR_MERGE_TREE_SETTINGS(ADD_SETTING)
|
|
|
|
#undef ADD_SETTING
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|