Move functions registration to .cpp

This commit is contained in:
Dmitrii Kovalkov 2023-03-29 09:45:32 +03:00
parent c82b1d2b59
commit c984526288
2 changed files with 30 additions and 21 deletions

View File

@ -0,0 +1,28 @@
#include <Functions/FunctionsJSON.h>
#include <Functions/FunctionFactory.h>
namespace DB
{
REGISTER_FUNCTION(JSON)
{
factory.registerFunction<JSONOverloadResolver<NameJSONHas, JSONHasImpl>>();
factory.registerFunction<JSONOverloadResolver<NameIsValidJSON, IsValidJSONImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONLength, JSONLengthImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONKey, JSONKeyImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONType, JSONTypeImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtractInt, JSONExtractInt64Impl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtractUInt, JSONExtractUInt64Impl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtractFloat, JSONExtractFloat64Impl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtractBool, JSONExtractBoolImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtractString, JSONExtractStringImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtract, JSONExtractImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtractKeysAndValues, JSONExtractKeysAndValuesImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtractRaw, JSONExtractRawImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtractArrayRaw, JSONExtractArrayRawImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtractKeysAndValuesRaw, JSONExtractKeysAndValuesRawImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtractKeys, JSONExtractKeysImpl>>();
}
}

View File

@ -1,3 +1,5 @@
#pragma once
#include <type_traits> #include <type_traits>
#include <boost/tti/has_member_function.hpp> #include <boost/tti/has_member_function.hpp>
@ -34,7 +36,6 @@
#include <DataTypes/DataTypesNumber.h> #include <DataTypes/DataTypesNumber.h>
#include <DataTypes/Serializations/SerializationDecimal.h> #include <DataTypes/Serializations/SerializationDecimal.h>
#include <Functions/FunctionFactory.h>
#include <Functions/IFunction.h> #include <Functions/IFunction.h>
#include <Common/JSONParsers/DummyJSONParser.h> #include <Common/JSONParsers/DummyJSONParser.h>
#include <Common/JSONParsers/SimdJSONParser.h> #include <Common/JSONParsers/SimdJSONParser.h>
@ -1619,24 +1620,4 @@ public:
} }
}; };
REGISTER_FUNCTION(JSON)
{
factory.registerFunction<JSONOverloadResolver<NameJSONHas, JSONHasImpl>>();
factory.registerFunction<JSONOverloadResolver<NameIsValidJSON, IsValidJSONImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONLength, JSONLengthImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONKey, JSONKeyImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONType, JSONTypeImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtractInt, JSONExtractInt64Impl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtractUInt, JSONExtractUInt64Impl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtractFloat, JSONExtractFloat64Impl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtractBool, JSONExtractBoolImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtractString, JSONExtractStringImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtract, JSONExtractImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtractKeysAndValues, JSONExtractKeysAndValuesImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtractRaw, JSONExtractRawImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtractArrayRaw, JSONExtractArrayRawImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtractKeysAndValuesRaw, JSONExtractKeysAndValuesRawImpl>>();
factory.registerFunction<JSONOverloadResolver<NameJSONExtractKeys, JSONExtractKeysImpl>>();
}
} }