2017-04-01 09:19:00 +00:00
|
|
|
#include <Functions/FunctionFactory.h>
|
|
|
|
#include <Functions/FunctionsConversion.h>
|
2019-12-29 01:13:17 +00:00
|
|
|
|
2014-08-22 00:57:20 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2020-06-20 15:45:50 +00:00
|
|
|
void registerFunctionFixedString(FunctionFactory & factory);
|
|
|
|
|
2021-08-11 19:09:51 +00:00
|
|
|
void registerCastOverloadResolvers(FunctionFactory & factory);
|
|
|
|
|
2014-08-22 00:57:20 +00:00
|
|
|
void registerFunctionsConversion(FunctionFactory & factory)
|
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
factory.registerFunction<FunctionToUInt8>();
|
|
|
|
factory.registerFunction<FunctionToUInt16>();
|
|
|
|
factory.registerFunction<FunctionToUInt32>();
|
|
|
|
factory.registerFunction<FunctionToUInt64>();
|
2021-05-03 15:41:37 +00:00
|
|
|
factory.registerFunction<FunctionToUInt128>();
|
2020-08-19 11:52:17 +00:00
|
|
|
factory.registerFunction<FunctionToUInt256>();
|
2017-04-01 07:20:54 +00:00
|
|
|
factory.registerFunction<FunctionToInt8>();
|
|
|
|
factory.registerFunction<FunctionToInt16>();
|
|
|
|
factory.registerFunction<FunctionToInt32>();
|
|
|
|
factory.registerFunction<FunctionToInt64>();
|
2020-08-19 11:52:17 +00:00
|
|
|
factory.registerFunction<FunctionToInt128>();
|
|
|
|
factory.registerFunction<FunctionToInt256>();
|
2017-04-01 07:20:54 +00:00
|
|
|
factory.registerFunction<FunctionToFloat32>();
|
|
|
|
factory.registerFunction<FunctionToFloat64>();
|
2017-10-30 02:18:06 +00:00
|
|
|
|
2018-08-22 16:16:39 +00:00
|
|
|
factory.registerFunction<FunctionToDecimal32>();
|
|
|
|
factory.registerFunction<FunctionToDecimal64>();
|
2018-08-22 17:26:11 +00:00
|
|
|
factory.registerFunction<FunctionToDecimal128>();
|
2020-08-19 11:52:17 +00:00
|
|
|
factory.registerFunction<FunctionToDecimal256>();
|
2018-08-21 18:25:38 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
factory.registerFunction<FunctionToDate>();
|
2021-12-22 16:41:52 +00:00
|
|
|
/// MysQL compatibility alias.
|
2021-01-21 21:02:35 +00:00
|
|
|
factory.registerFunction<FunctionToDate>("DATE", FunctionFactory::CaseInsensitive);
|
2021-07-15 11:41:52 +00:00
|
|
|
factory.registerFunction<FunctionToDate32>();
|
2017-04-01 07:20:54 +00:00
|
|
|
factory.registerFunction<FunctionToDateTime>();
|
2020-08-15 13:29:24 +00:00
|
|
|
factory.registerFunction<FunctionToDateTime32>();
|
2019-10-12 07:03:38 +00:00
|
|
|
factory.registerFunction<FunctionToDateTime64>();
|
2017-07-04 10:42:53 +00:00
|
|
|
factory.registerFunction<FunctionToUUID>();
|
2017-04-01 07:20:54 +00:00
|
|
|
factory.registerFunction<FunctionToString>();
|
2020-06-20 15:45:50 +00:00
|
|
|
|
|
|
|
registerFunctionFixedString(factory);
|
2017-10-30 02:18:06 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
factory.registerFunction<FunctionToUnixTimestamp>();
|
2020-12-05 13:18:56 +00:00
|
|
|
|
2021-08-11 19:09:51 +00:00
|
|
|
registerCastOverloadResolvers(factory);
|
2017-10-30 02:18:06 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
factory.registerFunction<FunctionToUInt8OrZero>();
|
|
|
|
factory.registerFunction<FunctionToUInt16OrZero>();
|
|
|
|
factory.registerFunction<FunctionToUInt32OrZero>();
|
|
|
|
factory.registerFunction<FunctionToUInt64OrZero>();
|
2021-05-03 15:41:37 +00:00
|
|
|
factory.registerFunction<FunctionToUInt128OrZero>();
|
2020-08-19 11:52:17 +00:00
|
|
|
factory.registerFunction<FunctionToUInt256OrZero>();
|
2017-04-01 07:20:54 +00:00
|
|
|
factory.registerFunction<FunctionToInt8OrZero>();
|
|
|
|
factory.registerFunction<FunctionToInt16OrZero>();
|
|
|
|
factory.registerFunction<FunctionToInt32OrZero>();
|
|
|
|
factory.registerFunction<FunctionToInt64OrZero>();
|
2020-08-19 11:52:17 +00:00
|
|
|
factory.registerFunction<FunctionToInt128OrZero>();
|
|
|
|
factory.registerFunction<FunctionToInt256OrZero>();
|
2017-04-01 07:20:54 +00:00
|
|
|
factory.registerFunction<FunctionToFloat32OrZero>();
|
|
|
|
factory.registerFunction<FunctionToFloat64OrZero>();
|
2018-02-11 23:57:07 +00:00
|
|
|
factory.registerFunction<FunctionToDateOrZero>();
|
2021-07-15 11:41:52 +00:00
|
|
|
factory.registerFunction<FunctionToDate32OrZero>();
|
2018-02-11 23:57:07 +00:00
|
|
|
factory.registerFunction<FunctionToDateTimeOrZero>();
|
2019-10-12 07:03:38 +00:00
|
|
|
factory.registerFunction<FunctionToDateTime64OrZero>();
|
2017-10-30 02:18:06 +00:00
|
|
|
|
2019-05-15 18:50:35 +00:00
|
|
|
factory.registerFunction<FunctionToDecimal32OrZero>();
|
|
|
|
factory.registerFunction<FunctionToDecimal64OrZero>();
|
|
|
|
factory.registerFunction<FunctionToDecimal128OrZero>();
|
2020-08-19 11:52:17 +00:00
|
|
|
factory.registerFunction<FunctionToDecimal256OrZero>();
|
2019-05-15 18:50:35 +00:00
|
|
|
|
2020-10-25 08:45:29 +00:00
|
|
|
factory.registerFunction<FunctionToUUIDOrZero>();
|
|
|
|
|
2017-12-25 05:22:33 +00:00
|
|
|
factory.registerFunction<FunctionToUInt8OrNull>();
|
|
|
|
factory.registerFunction<FunctionToUInt16OrNull>();
|
|
|
|
factory.registerFunction<FunctionToUInt32OrNull>();
|
|
|
|
factory.registerFunction<FunctionToUInt64OrNull>();
|
2021-05-03 15:41:37 +00:00
|
|
|
factory.registerFunction<FunctionToUInt128OrNull>();
|
2020-08-19 11:52:17 +00:00
|
|
|
factory.registerFunction<FunctionToUInt256OrNull>();
|
2017-12-25 05:22:33 +00:00
|
|
|
factory.registerFunction<FunctionToInt8OrNull>();
|
|
|
|
factory.registerFunction<FunctionToInt16OrNull>();
|
|
|
|
factory.registerFunction<FunctionToInt32OrNull>();
|
|
|
|
factory.registerFunction<FunctionToInt64OrNull>();
|
2020-08-19 11:52:17 +00:00
|
|
|
factory.registerFunction<FunctionToInt128OrNull>();
|
|
|
|
factory.registerFunction<FunctionToInt256OrNull>();
|
2017-12-25 05:22:33 +00:00
|
|
|
factory.registerFunction<FunctionToFloat32OrNull>();
|
|
|
|
factory.registerFunction<FunctionToFloat64OrNull>();
|
2018-02-11 23:57:07 +00:00
|
|
|
factory.registerFunction<FunctionToDateOrNull>();
|
2021-07-15 11:41:52 +00:00
|
|
|
factory.registerFunction<FunctionToDate32OrNull>();
|
2018-02-11 23:57:07 +00:00
|
|
|
factory.registerFunction<FunctionToDateTimeOrNull>();
|
2019-10-12 07:03:38 +00:00
|
|
|
factory.registerFunction<FunctionToDateTime64OrNull>();
|
2018-02-11 23:57:07 +00:00
|
|
|
|
2019-05-15 18:50:35 +00:00
|
|
|
factory.registerFunction<FunctionToDecimal32OrNull>();
|
|
|
|
factory.registerFunction<FunctionToDecimal64OrNull>();
|
|
|
|
factory.registerFunction<FunctionToDecimal128OrNull>();
|
2020-08-19 11:52:17 +00:00
|
|
|
factory.registerFunction<FunctionToDecimal256OrNull>();
|
2019-05-15 18:50:35 +00:00
|
|
|
|
2020-10-25 08:45:29 +00:00
|
|
|
factory.registerFunction<FunctionToUUIDOrNull>();
|
|
|
|
|
2018-02-11 23:57:07 +00:00
|
|
|
factory.registerFunction<FunctionParseDateTimeBestEffort>();
|
|
|
|
factory.registerFunction<FunctionParseDateTimeBestEffortOrZero>();
|
|
|
|
factory.registerFunction<FunctionParseDateTimeBestEffortOrNull>();
|
2021-01-27 14:10:06 +00:00
|
|
|
factory.registerFunction<FunctionParseDateTimeBestEffortUS>();
|
|
|
|
factory.registerFunction<FunctionParseDateTimeBestEffortUSOrZero>();
|
|
|
|
factory.registerFunction<FunctionParseDateTimeBestEffortUSOrNull>();
|
2020-08-21 05:06:06 +00:00
|
|
|
factory.registerFunction<FunctionParseDateTime32BestEffort>();
|
|
|
|
factory.registerFunction<FunctionParseDateTime32BestEffortOrZero>();
|
|
|
|
factory.registerFunction<FunctionParseDateTime32BestEffortOrNull>();
|
2019-10-12 07:03:38 +00:00
|
|
|
factory.registerFunction<FunctionParseDateTime64BestEffort>();
|
|
|
|
factory.registerFunction<FunctionParseDateTime64BestEffortOrZero>();
|
|
|
|
factory.registerFunction<FunctionParseDateTime64BestEffortOrNull>();
|
2017-12-25 05:22:33 +00:00
|
|
|
|
2017-10-30 02:18:06 +00:00
|
|
|
factory.registerFunction<FunctionConvert<DataTypeInterval, NameToIntervalSecond, PositiveMonotonicity>>();
|
|
|
|
factory.registerFunction<FunctionConvert<DataTypeInterval, NameToIntervalMinute, PositiveMonotonicity>>();
|
|
|
|
factory.registerFunction<FunctionConvert<DataTypeInterval, NameToIntervalHour, PositiveMonotonicity>>();
|
|
|
|
factory.registerFunction<FunctionConvert<DataTypeInterval, NameToIntervalDay, PositiveMonotonicity>>();
|
|
|
|
factory.registerFunction<FunctionConvert<DataTypeInterval, NameToIntervalWeek, PositiveMonotonicity>>();
|
|
|
|
factory.registerFunction<FunctionConvert<DataTypeInterval, NameToIntervalMonth, PositiveMonotonicity>>();
|
2018-12-18 13:16:48 +00:00
|
|
|
factory.registerFunction<FunctionConvert<DataTypeInterval, NameToIntervalQuarter, PositiveMonotonicity>>();
|
2017-10-30 02:18:06 +00:00
|
|
|
factory.registerFunction<FunctionConvert<DataTypeInterval, NameToIntervalYear, PositiveMonotonicity>>();
|
2014-08-22 00:57:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|