2017-04-01 09:19:00 +00:00
|
|
|
#include <AggregateFunctions/AggregateFunctionFactory.h>
|
|
|
|
#include <DataTypes/DataTypeString.h>
|
|
|
|
#include <DataTypes/DataTypesNumber.h>
|
2018-07-24 14:28:56 +00:00
|
|
|
#include <Functions/FunctionFactory.h>
|
|
|
|
#include <Functions/IFunction.h>
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <Interpreters/Context.h>
|
2018-07-24 14:28:56 +00:00
|
|
|
#include <Storages/System/StorageSystemFunctions.h>
|
2016-12-08 02:49:04 +00:00
|
|
|
|
2015-04-24 15:49:30 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2018-07-24 14:28:56 +00:00
|
|
|
NamesAndTypesList StorageSystemFunctions::getNamesAndTypes()
|
2018-01-25 14:42:39 +00:00
|
|
|
{
|
2018-07-24 14:28:56 +00:00
|
|
|
return {
|
|
|
|
{"name", std::make_shared<DataTypeString>()},
|
|
|
|
{"is_aggregate", std::make_shared<DataTypeUInt8>()},
|
|
|
|
};
|
2015-04-24 15:49:30 +00:00
|
|
|
}
|
|
|
|
|
2018-07-24 14:28:56 +00:00
|
|
|
void StorageSystemFunctions::fillData(MutableColumns & res_columns, const Context &, const SelectQueryInfo &) const
|
2015-04-24 15:49:30 +00:00
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
const auto & functions = FunctionFactory::instance().functions;
|
|
|
|
for (const auto & it : functions)
|
|
|
|
{
|
2017-12-16 00:49:03 +00:00
|
|
|
res_columns[0]->insert(it.first);
|
|
|
|
res_columns[1]->insert(UInt64(0));
|
2017-04-01 07:20:54 +00:00
|
|
|
}
|
|
|
|
|
2017-05-05 20:39:25 +00:00
|
|
|
const auto & aggregate_functions = AggregateFunctionFactory::instance().aggregate_functions;
|
2017-04-01 07:20:54 +00:00
|
|
|
for (const auto & it : aggregate_functions)
|
|
|
|
{
|
2017-12-16 00:49:03 +00:00
|
|
|
res_columns[0]->insert(it.first);
|
|
|
|
res_columns[1]->insert(UInt64(1));
|
2017-04-01 07:20:54 +00:00
|
|
|
}
|
2015-04-24 15:49:30 +00:00
|
|
|
}
|
|
|
|
|
2015-09-24 03:50:09 +00:00
|
|
|
}
|