ClickHouse/dbms/src/Storages/System/StorageSystemFunctions.cpp

39 lines
1.1 KiB
C++
Raw Normal View History

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