mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-30 19:42:00 +00:00
Merge pull request #72352 from ClickHouse/build-large-translation-units
Build: attempt to split large translation units.
This commit is contained in:
commit
2959e1217b
@ -18,6 +18,10 @@ set(DBMS_FUNCTIONS
|
||||
checkHyperscanRegexp.cpp # checkHyperscanRegexp (Used by MultiMatchAnyImpl.h, multiMatchAny.cpp)
|
||||
CastOverloadResolver.cpp # createInternalCast (Used by WindowTransform.cpp, KeyCondition.cpp...)
|
||||
FunctionsConversion.cpp # createFunctionBaseCast (Used by CastOverloadResolver.cpp)
|
||||
FunctionsConversion_impl0.cpp
|
||||
FunctionsConversion_impl1.cpp
|
||||
FunctionsConversion_impl2.cpp
|
||||
FunctionsConversion_impl3.cpp
|
||||
extractTimeZoneFromFunctionArguments.cpp # extractTimeZoneFromFunctionArguments (DateTimeTransforms.h, FunctionsConversion.cpp)
|
||||
)
|
||||
extract_into_parent_list(clickhouse_functions_sources dbms_sources ${DBMS_FUNCTIONS})
|
||||
|
File diff suppressed because it is too large
Load Diff
5514
src/Functions/FunctionsConversion.h
Normal file
5514
src/Functions/FunctionsConversion.h
Normal file
File diff suppressed because it is too large
Load Diff
47
src/Functions/FunctionsConversion_impl0.cpp
Normal file
47
src/Functions/FunctionsConversion_impl0.cpp
Normal file
@ -0,0 +1,47 @@
|
||||
#include <Functions/FunctionsConversion.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template class FunctionConvert<DataTypeUInt8, NameToUInt8, ToNumberMonotonicity<UInt8>>;
|
||||
template class FunctionConvert<DataTypeUInt16, NameToUInt16, ToNumberMonotonicity<UInt16>>;
|
||||
template class FunctionConvert<DataTypeUInt32, NameToUInt32, ToNumberMonotonicity<UInt32>>;
|
||||
template class FunctionConvert<DataTypeUInt64, NameToUInt64, ToNumberMonotonicity<UInt64>>;
|
||||
template class FunctionConvert<DataTypeUInt128, NameToUInt128, ToNumberMonotonicity<UInt128>>;
|
||||
template class FunctionConvert<DataTypeUInt256, NameToUInt256, ToNumberMonotonicity<UInt256>>;
|
||||
template class FunctionConvert<DataTypeInt8, NameToInt8, ToNumberMonotonicity<Int8>>;
|
||||
template class FunctionConvert<DataTypeInt16, NameToInt16, ToNumberMonotonicity<Int16>>;
|
||||
template class FunctionConvert<DataTypeInt32, NameToInt32, ToNumberMonotonicity<Int32>>;
|
||||
template class FunctionConvert<DataTypeInt64, NameToInt64, ToNumberMonotonicity<Int64>>;
|
||||
template class FunctionConvert<DataTypeInt128, NameToInt128, ToNumberMonotonicity<Int128>>;
|
||||
template class FunctionConvert<DataTypeInt256, NameToInt256, ToNumberMonotonicity<Int256>>;
|
||||
template class FunctionConvert<DataTypeBFloat16, NameToBFloat16, ToNumberMonotonicity<BFloat16>>;
|
||||
template class FunctionConvert<DataTypeFloat32, NameToFloat32, ToNumberMonotonicity<Float32>>;
|
||||
template class FunctionConvert<DataTypeFloat64, NameToFloat64, ToNumberMonotonicity<Float64>>;
|
||||
|
||||
template class FunctionConvert<DataTypeDate, NameToDate, ToDateMonotonicity>;
|
||||
|
||||
template class FunctionConvert<DataTypeDate32, NameToDate32, ToDateMonotonicity>;
|
||||
|
||||
template class FunctionConvert<DataTypeDateTime, NameToDateTime, ToDateTimeMonotonicity>;
|
||||
|
||||
template class FunctionConvert<DataTypeDateTime, NameToDateTime32, ToDateTimeMonotonicity>;
|
||||
|
||||
template class FunctionConvert<DataTypeDateTime64, NameToDateTime64, ToDateTimeMonotonicity>;
|
||||
|
||||
template class FunctionConvert<DataTypeUUID, NameToUUID, ToNumberMonotonicity<UInt128>>;
|
||||
template class FunctionConvert<DataTypeIPv4, NameToIPv4, ToNumberMonotonicity<UInt32>>;
|
||||
template class FunctionConvert<DataTypeIPv6, NameToIPv6, ToNumberMonotonicity<UInt128>>;
|
||||
template class FunctionConvert<DataTypeString, NameToString, ToStringMonotonicity>;
|
||||
template class FunctionConvert<DataTypeUInt32, NameToUnixTimestamp, ToNumberMonotonicity<UInt32>>;
|
||||
template class FunctionConvert<DataTypeDecimal<Decimal32>, NameToDecimal32, UnknownMonotonicity>;
|
||||
template class FunctionConvert<DataTypeDecimal<Decimal64>, NameToDecimal64, UnknownMonotonicity>;
|
||||
template class FunctionConvert<DataTypeDecimal<Decimal128>, NameToDecimal128, UnknownMonotonicity>;
|
||||
template class FunctionConvert<DataTypeDecimal<Decimal256>, NameToDecimal256, UnknownMonotonicity>;
|
||||
|
||||
}
|
||||
|
||||
}
|
38
src/Functions/FunctionsConversion_impl1.cpp
Normal file
38
src/Functions/FunctionsConversion_impl1.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
#include <Functions/FunctionsConversion.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template class FunctionConvertFromString<DataTypeUInt8, NameToUInt8OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeUInt16, NameToUInt16OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeUInt32, NameToUInt32OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeUInt64, NameToUInt64OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeUInt128, NameToUInt128OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeUInt256, NameToUInt256OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeInt8, NameToInt8OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeInt16, NameToInt16OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeInt32, NameToInt32OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeInt64, NameToInt64OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeInt128, NameToInt128OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeInt256, NameToInt256OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeBFloat16, NameToBFloat16OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeFloat32, NameToFloat32OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeFloat64, NameToFloat64OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeDate, NameToDateOrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeDate32, NameToDate32OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeDateTime, NameToDateTimeOrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeDateTime64, NameToDateTime64OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeDecimal<Decimal32>, NameToDecimal32OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeDecimal<Decimal64>, NameToDecimal64OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeDecimal<Decimal128>, NameToDecimal128OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeDecimal<Decimal256>, NameToDecimal256OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeUUID, NameToUUIDOrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeIPv4, NameToIPv4OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
template class FunctionConvertFromString<DataTypeIPv6, NameToIPv6OrZero, ConvertFromStringExceptionMode::Zero>;
|
||||
|
||||
}
|
||||
|
||||
}
|
38
src/Functions/FunctionsConversion_impl2.cpp
Normal file
38
src/Functions/FunctionsConversion_impl2.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
#include <Functions/FunctionsConversion.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template class FunctionConvertFromString<DataTypeUInt8, NameToUInt8OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeUInt16, NameToUInt16OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeUInt32, NameToUInt32OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeUInt64, NameToUInt64OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeUInt128, NameToUInt128OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeUInt256, NameToUInt256OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeInt8, NameToInt8OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeInt16, NameToInt16OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeInt32, NameToInt32OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeInt64, NameToInt64OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeInt128, NameToInt128OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeInt256, NameToInt256OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeBFloat16, NameToBFloat16OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeFloat32, NameToFloat32OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeFloat64, NameToFloat64OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeDate, NameToDateOrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeDate32, NameToDate32OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeDateTime, NameToDateTimeOrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeDateTime64, NameToDateTime64OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeDecimal<Decimal32>, NameToDecimal32OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeDecimal<Decimal64>, NameToDecimal64OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeDecimal<Decimal128>, NameToDecimal128OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeDecimal<Decimal256>, NameToDecimal256OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeUUID, NameToUUIDOrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeIPv4, NameToIPv4OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
template class FunctionConvertFromString<DataTypeIPv6, NameToIPv6OrNull, ConvertFromStringExceptionMode::Null>;
|
||||
|
||||
}
|
||||
|
||||
}
|
46
src/Functions/FunctionsConversion_impl3.cpp
Normal file
46
src/Functions/FunctionsConversion_impl3.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
#include <Functions/FunctionsConversion.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template class FunctionConvertFromString<
|
||||
DataTypeDateTime, NameParseDateTimeBestEffort, ConvertFromStringExceptionMode::Throw, ConvertFromStringParsingMode::BestEffort>;
|
||||
template class FunctionConvertFromString<
|
||||
DataTypeDateTime, NameParseDateTimeBestEffortOrZero, ConvertFromStringExceptionMode::Zero, ConvertFromStringParsingMode::BestEffort>;
|
||||
template class FunctionConvertFromString<
|
||||
DataTypeDateTime, NameParseDateTimeBestEffortOrNull, ConvertFromStringExceptionMode::Null, ConvertFromStringParsingMode::BestEffort>;
|
||||
|
||||
template class FunctionConvertFromString<
|
||||
DataTypeDateTime, NameParseDateTimeBestEffortUS, ConvertFromStringExceptionMode::Throw, ConvertFromStringParsingMode::BestEffortUS>;
|
||||
template class FunctionConvertFromString<
|
||||
DataTypeDateTime, NameParseDateTimeBestEffortUSOrZero, ConvertFromStringExceptionMode::Zero, ConvertFromStringParsingMode::BestEffortUS>;
|
||||
template class FunctionConvertFromString<
|
||||
DataTypeDateTime, NameParseDateTimeBestEffortUSOrNull, ConvertFromStringExceptionMode::Null, ConvertFromStringParsingMode::BestEffortUS>;
|
||||
|
||||
template class FunctionConvertFromString<
|
||||
DataTypeDateTime, NameParseDateTime32BestEffort, ConvertFromStringExceptionMode::Throw, ConvertFromStringParsingMode::BestEffort>;
|
||||
template class FunctionConvertFromString<
|
||||
DataTypeDateTime, NameParseDateTime32BestEffortOrZero, ConvertFromStringExceptionMode::Zero, ConvertFromStringParsingMode::BestEffort>;
|
||||
template class FunctionConvertFromString<
|
||||
DataTypeDateTime, NameParseDateTime32BestEffortOrNull, ConvertFromStringExceptionMode::Null, ConvertFromStringParsingMode::BestEffort>;
|
||||
|
||||
template class FunctionConvertFromString<
|
||||
DataTypeDateTime64, NameParseDateTime64BestEffort, ConvertFromStringExceptionMode::Throw, ConvertFromStringParsingMode::BestEffort>;
|
||||
template class FunctionConvertFromString<
|
||||
DataTypeDateTime64, NameParseDateTime64BestEffortOrZero, ConvertFromStringExceptionMode::Zero, ConvertFromStringParsingMode::BestEffort>;
|
||||
template class FunctionConvertFromString<
|
||||
DataTypeDateTime64, NameParseDateTime64BestEffortOrNull, ConvertFromStringExceptionMode::Null, ConvertFromStringParsingMode::BestEffort>;
|
||||
|
||||
template class FunctionConvertFromString<
|
||||
DataTypeDateTime64, NameParseDateTime64BestEffortUS, ConvertFromStringExceptionMode::Throw, ConvertFromStringParsingMode::BestEffortUS>;
|
||||
template class FunctionConvertFromString<
|
||||
DataTypeDateTime64, NameParseDateTime64BestEffortUSOrZero, ConvertFromStringExceptionMode::Zero, ConvertFromStringParsingMode::BestEffortUS>;
|
||||
template class FunctionConvertFromString<
|
||||
DataTypeDateTime64, NameParseDateTime64BestEffortUSOrNull, ConvertFromStringExceptionMode::Null, ConvertFromStringParsingMode::BestEffortUS>;
|
||||
|
||||
}
|
||||
|
||||
}
|
192
src/Functions/FunctionsConversion_reg.cpp
Normal file
192
src/Functions/FunctionsConversion_reg.cpp
Normal file
@ -0,0 +1,192 @@
|
||||
#include <Functions/FunctionsConversion.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
REGISTER_FUNCTION(Conversion)
|
||||
{
|
||||
factory.registerFunction<detail::FunctionToUInt8>();
|
||||
factory.registerFunction<detail::FunctionToUInt16>();
|
||||
factory.registerFunction<detail::FunctionToUInt32>();
|
||||
factory.registerFunction<detail::FunctionToUInt64>();
|
||||
factory.registerFunction<detail::FunctionToUInt128>();
|
||||
factory.registerFunction<detail::FunctionToUInt256>();
|
||||
factory.registerFunction<detail::FunctionToInt8>();
|
||||
factory.registerFunction<detail::FunctionToInt16>();
|
||||
factory.registerFunction<detail::FunctionToInt32>();
|
||||
factory.registerFunction<detail::FunctionToInt64>();
|
||||
factory.registerFunction<detail::FunctionToInt128>();
|
||||
factory.registerFunction<detail::FunctionToInt256>();
|
||||
|
||||
factory.registerFunction<detail::FunctionToBFloat16>(FunctionDocumentation{.description=R"(
|
||||
Converts Float32 to BFloat16 with losing the precision.
|
||||
|
||||
Example:
|
||||
[example:typical]
|
||||
)",
|
||||
.examples{
|
||||
{"typical", "SELECT toBFloat16(12.3::Float32);", "12.3125"}},
|
||||
.categories{"Conversion"}});
|
||||
|
||||
factory.registerFunction<detail::FunctionToFloat32>();
|
||||
factory.registerFunction<detail::FunctionToFloat64>();
|
||||
|
||||
factory.registerFunction<detail::FunctionToDecimal32>();
|
||||
factory.registerFunction<detail::FunctionToDecimal64>();
|
||||
factory.registerFunction<detail::FunctionToDecimal128>();
|
||||
factory.registerFunction<detail::FunctionToDecimal256>();
|
||||
|
||||
factory.registerFunction<detail::FunctionToDate>();
|
||||
|
||||
/// MySQL compatibility alias. Cannot be registered as alias,
|
||||
/// because we don't want it to be normalized to toDate in queries,
|
||||
/// otherwise CREATE DICTIONARY query breaks.
|
||||
factory.registerFunction("DATE", &detail::FunctionToDate::create, {}, FunctionFactory::Case::Insensitive);
|
||||
|
||||
factory.registerFunction<detail::FunctionToDate32>();
|
||||
factory.registerFunction<detail::FunctionToDateTime>();
|
||||
factory.registerFunction<detail::FunctionToDateTime32>();
|
||||
factory.registerFunction<detail::FunctionToDateTime64>();
|
||||
factory.registerFunction<detail::FunctionToUUID>();
|
||||
factory.registerFunction<detail::FunctionToIPv4>();
|
||||
factory.registerFunction<detail::FunctionToIPv6>();
|
||||
factory.registerFunction<detail::FunctionToString>();
|
||||
|
||||
factory.registerFunction<detail::FunctionToUnixTimestamp>();
|
||||
|
||||
factory.registerFunction<detail::FunctionToUInt8OrZero>();
|
||||
factory.registerFunction<detail::FunctionToUInt16OrZero>();
|
||||
factory.registerFunction<detail::FunctionToUInt32OrZero>();
|
||||
factory.registerFunction<detail::FunctionToUInt64OrZero>();
|
||||
factory.registerFunction<detail::FunctionToUInt128OrZero>();
|
||||
factory.registerFunction<detail::FunctionToUInt256OrZero>();
|
||||
factory.registerFunction<detail::FunctionToInt8OrZero>();
|
||||
factory.registerFunction<detail::FunctionToInt16OrZero>();
|
||||
factory.registerFunction<detail::FunctionToInt32OrZero>();
|
||||
factory.registerFunction<detail::FunctionToInt64OrZero>();
|
||||
factory.registerFunction<detail::FunctionToInt128OrZero>();
|
||||
factory.registerFunction<detail::FunctionToInt256OrZero>();
|
||||
|
||||
factory.registerFunction<detail::FunctionToBFloat16OrZero>(FunctionDocumentation{.description=R"(
|
||||
Converts String to BFloat16.
|
||||
|
||||
If the string does not represent a floating point value, the function returns zero.
|
||||
|
||||
The function allows a silent loss of precision while converting from the string representation. In that case, it will return the truncated result.
|
||||
|
||||
Example of successful conversion:
|
||||
[example:typical]
|
||||
|
||||
Examples of not successful conversion:
|
||||
[example:invalid1]
|
||||
[example:invalid2]
|
||||
|
||||
Example of a loss of precision:
|
||||
[example:precision]
|
||||
)",
|
||||
.examples{
|
||||
{"typical", "SELECT toBFloat16OrZero('12.3');", "12.3125"},
|
||||
{"invalid1", "SELECT toBFloat16OrZero('abc');", "0"},
|
||||
{"invalid2", "SELECT toBFloat16OrZero(' 1');", "0"},
|
||||
{"precision", "SELECT toBFloat16OrZero('12.3456789');", "12.375"}},
|
||||
.categories{"Conversion"}});
|
||||
|
||||
factory.registerFunction<detail::FunctionToFloat32OrZero>();
|
||||
factory.registerFunction<detail::FunctionToFloat64OrZero>();
|
||||
factory.registerFunction<detail::FunctionToDateOrZero>();
|
||||
factory.registerFunction<detail::FunctionToDate32OrZero>();
|
||||
factory.registerFunction<detail::FunctionToDateTimeOrZero>();
|
||||
factory.registerFunction<detail::FunctionToDateTime64OrZero>();
|
||||
|
||||
factory.registerFunction<detail::FunctionToDecimal32OrZero>();
|
||||
factory.registerFunction<detail::FunctionToDecimal64OrZero>();
|
||||
factory.registerFunction<detail::FunctionToDecimal128OrZero>();
|
||||
factory.registerFunction<detail::FunctionToDecimal256OrZero>();
|
||||
|
||||
factory.registerFunction<detail::FunctionToUUIDOrZero>();
|
||||
factory.registerFunction<detail::FunctionToIPv4OrZero>();
|
||||
factory.registerFunction<detail::FunctionToIPv6OrZero>();
|
||||
|
||||
factory.registerFunction<detail::FunctionToUInt8OrNull>();
|
||||
factory.registerFunction<detail::FunctionToUInt16OrNull>();
|
||||
factory.registerFunction<detail::FunctionToUInt32OrNull>();
|
||||
factory.registerFunction<detail::FunctionToUInt64OrNull>();
|
||||
factory.registerFunction<detail::FunctionToUInt128OrNull>();
|
||||
factory.registerFunction<detail::FunctionToUInt256OrNull>();
|
||||
factory.registerFunction<detail::FunctionToInt8OrNull>();
|
||||
factory.registerFunction<detail::FunctionToInt16OrNull>();
|
||||
factory.registerFunction<detail::FunctionToInt32OrNull>();
|
||||
factory.registerFunction<detail::FunctionToInt64OrNull>();
|
||||
factory.registerFunction<detail::FunctionToInt128OrNull>();
|
||||
factory.registerFunction<detail::FunctionToInt256OrNull>();
|
||||
|
||||
factory.registerFunction<detail::FunctionToBFloat16OrNull>(FunctionDocumentation{.description=R"(
|
||||
Converts String to Nullable(BFloat16).
|
||||
|
||||
If the string does not represent a floating point value, the function returns NULL.
|
||||
|
||||
The function allows a silent loss of precision while converting from the string representation. In that case, it will return the truncated result.
|
||||
|
||||
Example of successful conversion:
|
||||
[example:typical]
|
||||
|
||||
Examples of not successful conversion:
|
||||
[example:invalid1]
|
||||
[example:invalid2]
|
||||
|
||||
Example of a loss of precision:
|
||||
[example:precision]
|
||||
)",
|
||||
.examples{
|
||||
{"typical", "SELECT toBFloat16OrNull('12.3');", "12.3125"},
|
||||
{"invalid1", "SELECT toBFloat16OrNull('abc');", "NULL"},
|
||||
{"invalid2", "SELECT toBFloat16OrNull(' 1');", "NULL"},
|
||||
{"precision", "SELECT toBFloat16OrNull('12.3456789');", "12.375"}},
|
||||
.categories{"Conversion"}});
|
||||
|
||||
factory.registerFunction<detail::FunctionToFloat32OrNull>();
|
||||
factory.registerFunction<detail::FunctionToFloat64OrNull>();
|
||||
factory.registerFunction<detail::FunctionToDateOrNull>();
|
||||
factory.registerFunction<detail::FunctionToDate32OrNull>();
|
||||
factory.registerFunction<detail::FunctionToDateTimeOrNull>();
|
||||
factory.registerFunction<detail::FunctionToDateTime64OrNull>();
|
||||
|
||||
factory.registerFunction<detail::FunctionToDecimal32OrNull>();
|
||||
factory.registerFunction<detail::FunctionToDecimal64OrNull>();
|
||||
factory.registerFunction<detail::FunctionToDecimal128OrNull>();
|
||||
factory.registerFunction<detail::FunctionToDecimal256OrNull>();
|
||||
|
||||
factory.registerFunction<detail::FunctionToUUIDOrNull>();
|
||||
factory.registerFunction<detail::FunctionToIPv4OrNull>();
|
||||
factory.registerFunction<detail::FunctionToIPv6OrNull>();
|
||||
|
||||
factory.registerFunction<detail::FunctionParseDateTimeBestEffort>();
|
||||
factory.registerFunction<detail::FunctionParseDateTimeBestEffortOrZero>();
|
||||
factory.registerFunction<detail::FunctionParseDateTimeBestEffortOrNull>();
|
||||
factory.registerFunction<detail::FunctionParseDateTimeBestEffortUS>();
|
||||
factory.registerFunction<detail::FunctionParseDateTimeBestEffortUSOrZero>();
|
||||
factory.registerFunction<detail::FunctionParseDateTimeBestEffortUSOrNull>();
|
||||
factory.registerFunction<detail::FunctionParseDateTime32BestEffort>();
|
||||
factory.registerFunction<detail::FunctionParseDateTime32BestEffortOrZero>();
|
||||
factory.registerFunction<detail::FunctionParseDateTime32BestEffortOrNull>();
|
||||
factory.registerFunction<detail::FunctionParseDateTime64BestEffort>();
|
||||
factory.registerFunction<detail::FunctionParseDateTime64BestEffortOrZero>();
|
||||
factory.registerFunction<detail::FunctionParseDateTime64BestEffortOrNull>();
|
||||
factory.registerFunction<detail::FunctionParseDateTime64BestEffortUS>();
|
||||
factory.registerFunction<detail::FunctionParseDateTime64BestEffortUSOrZero>();
|
||||
factory.registerFunction<detail::FunctionParseDateTime64BestEffortUSOrNull>();
|
||||
|
||||
factory.registerFunction<detail::FunctionConvert<DataTypeInterval, detail::NameToIntervalNanosecond, detail::PositiveMonotonicity>>();
|
||||
factory.registerFunction<detail::FunctionConvert<DataTypeInterval, detail::NameToIntervalMicrosecond, detail::PositiveMonotonicity>>();
|
||||
factory.registerFunction<detail::FunctionConvert<DataTypeInterval, detail::NameToIntervalMillisecond, detail::PositiveMonotonicity>>();
|
||||
factory.registerFunction<detail::FunctionConvert<DataTypeInterval, detail::NameToIntervalSecond, detail::PositiveMonotonicity>>();
|
||||
factory.registerFunction<detail::FunctionConvert<DataTypeInterval, detail::NameToIntervalMinute, detail::PositiveMonotonicity>>();
|
||||
factory.registerFunction<detail::FunctionConvert<DataTypeInterval, detail::NameToIntervalHour, detail::PositiveMonotonicity>>();
|
||||
factory.registerFunction<detail::FunctionConvert<DataTypeInterval, detail::NameToIntervalDay, detail::PositiveMonotonicity>>();
|
||||
factory.registerFunction<detail::FunctionConvert<DataTypeInterval, detail::NameToIntervalWeek, detail::PositiveMonotonicity>>();
|
||||
factory.registerFunction<detail::FunctionConvert<DataTypeInterval, detail::NameToIntervalMonth, detail::PositiveMonotonicity>>();
|
||||
factory.registerFunction<detail::FunctionConvert<DataTypeInterval, detail::NameToIntervalQuarter, detail::PositiveMonotonicity>>();
|
||||
factory.registerFunction<detail::FunctionConvert<DataTypeInterval, detail::NameToIntervalYear, detail::PositiveMonotonicity>>();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user