2019-05-07 11:27:20 +00:00
|
|
|
#include <DataTypes/DataTypesNumber.h>
|
2019-06-09 15:19:15 +00:00
|
|
|
#include <Functions/CustomWeekTransforms.h>
|
|
|
|
#include <Functions/FunctionCustomWeekToSomething.h>
|
2022-08-25 08:11:21 +00:00
|
|
|
#include <Functions/FunctionCustomWeekToDateOrDate32.h>
|
2019-05-07 11:27:20 +00:00
|
|
|
#include <Functions/FunctionFactory.h>
|
2021-05-17 07:30:42 +00:00
|
|
|
#include <Functions/IFunction.h>
|
2019-05-05 07:54:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2019-06-18 09:48:07 +00:00
|
|
|
using FunctionToWeek = FunctionCustomWeekToSomething<DataTypeUInt8, ToWeekImpl>;
|
|
|
|
using FunctionToYearWeek = FunctionCustomWeekToSomething<DataTypeUInt32, ToYearWeekImpl>;
|
2022-08-25 08:11:21 +00:00
|
|
|
using FunctionToStartOfWeek = FunctionCustomWeekToDateOrDate32<ToStartOfWeekImpl>;
|
2023-05-18 21:47:52 +00:00
|
|
|
using FunctionToLastDayOfWeek = FunctionCustomWeekToDateOrDate32<ToLastDayOfWeekImpl>;
|
2019-05-05 07:54:51 +00:00
|
|
|
|
2022-07-04 07:01:39 +00:00
|
|
|
REGISTER_FUNCTION(ToCustomWeek)
|
2019-05-05 07:54:51 +00:00
|
|
|
{
|
2019-06-18 09:48:07 +00:00
|
|
|
factory.registerFunction<FunctionToWeek>();
|
|
|
|
factory.registerFunction<FunctionToYearWeek>();
|
2023-05-29 22:10:34 +00:00
|
|
|
factory.registerFunction<FunctionToStartOfWeek>();
|
|
|
|
factory.registerFunction<FunctionToLastDayOfWeek>();
|
2019-06-18 09:48:07 +00:00
|
|
|
|
|
|
|
/// Compatibility aliases for mysql.
|
|
|
|
factory.registerAlias("week", "toWeek", FunctionFactory::CaseInsensitive);
|
|
|
|
factory.registerAlias("yearweek", "toYearWeek", FunctionFactory::CaseInsensitive);
|
2019-05-05 07:54:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|