mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 05:22:17 +00:00
4088c0a7f3
Automated register all functions with below naming convention by iterating through the symbols: void DB::registerXXX(DB::FunctionFactory &)
26 lines
893 B
C++
26 lines
893 B
C++
#include <DataTypes/DataTypesNumber.h>
|
|
#include <Functions/CustomWeekTransforms.h>
|
|
#include <Functions/FunctionCustomWeekToSomething.h>
|
|
#include <Functions/FunctionFactory.h>
|
|
#include <Functions/IFunction.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
using FunctionToWeek = FunctionCustomWeekToSomething<DataTypeUInt8, ToWeekImpl>;
|
|
using FunctionToYearWeek = FunctionCustomWeekToSomething<DataTypeUInt32, ToYearWeekImpl>;
|
|
using FunctionToStartOfWeek = FunctionCustomWeekToSomething<DataTypeDate, ToStartOfWeekImpl>;
|
|
|
|
REGISTER_FUNCTION(ToCustomWeek)
|
|
{
|
|
factory.registerFunction<FunctionToWeek>();
|
|
factory.registerFunction<FunctionToYearWeek>();
|
|
factory.registerFunction<FunctionToStartOfWeek>();
|
|
|
|
/// Compatibility aliases for mysql.
|
|
factory.registerAlias("week", "toWeek", FunctionFactory::CaseInsensitive);
|
|
factory.registerAlias("yearweek", "toYearWeek", FunctionFactory::CaseInsensitive);
|
|
}
|
|
|
|
}
|