mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
Add case insensitive coalesce ifnull, nullif.
This commit is contained in:
parent
93f1ec2f02
commit
45ce69e73d
@ -19,9 +19,9 @@ void registerFunctionsNull(FunctionFactory & factory)
|
||||
{
|
||||
factory.registerFunction<FunctionIsNull>();
|
||||
factory.registerFunction<FunctionIsNotNull>();
|
||||
factory.registerFunction<FunctionCoalesce>();
|
||||
factory.registerFunction<FunctionIfNull>();
|
||||
factory.registerFunction<FunctionNullIf>();
|
||||
factory.registerFunction<FunctionCoalesce>(FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionIfNull>(FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionNullIf>(FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionAssumeNotNull>();
|
||||
factory.registerFunction<FunctionToNullable>();
|
||||
}
|
||||
|
@ -28,3 +28,8 @@ x Nullable(String)
|
||||
1 UInt8
|
||||
1 UInt8
|
||||
\N Nullable(Nothing)
|
||||
0 Nullable(String)
|
||||
-1 Nullable(String)
|
||||
2 Nullable(String)
|
||||
3 Nullable(String)
|
||||
4 Nullable(String)
|
||||
|
@ -17,3 +17,5 @@ SELECT ifNull(nullIf(toString(number), '1'), nullIf(toString(-number), '-3')) AS
|
||||
SELECT ifNull(NULL, 1) AS res, toTypeName(res);
|
||||
SELECT ifNull(1, NULL) AS res, toTypeName(res);
|
||||
SELECT ifNull(NULL, NULL) AS res, toTypeName(res);
|
||||
|
||||
SELECT IFNULL(NULLIF(toString(number), '1'), NULLIF(toString(-number), '-3')) AS res, toTypeName(res) FROM system.numbers LIMIT 5;
|
||||
|
@ -1,4 +1,5 @@
|
||||
\N \N \N 1 1 1 1
|
||||
\N \N 1
|
||||
0 Nullable(UInt64)
|
||||
\N Nullable(UInt64)
|
||||
2 Nullable(UInt64)
|
||||
|
@ -1,6 +1,8 @@
|
||||
SELECT coalesce(), coalesce(NULL), coalesce(NULL, NULL),
|
||||
coalesce(1), coalesce(1, NULL), coalesce(NULL, 1), coalesce(NULL, 1, NULL);
|
||||
|
||||
SELECT COALESCE(), COALESCE(NULL), COALESCE(1, NULL);
|
||||
|
||||
SELECT coalesce(number % 2 = 0 ? number : NULL, number % 3 = 0 ? number : NULL, number % 5 = 0 ? number : NULL) AS res, toTypeName(res) FROM system.numbers LIMIT 15;
|
||||
SELECT coalesce(number % 2 = 0 ? number : NULL, number % 3 = 0 ? number : NULL, number) AS res, toTypeName(res) FROM system.numbers LIMIT 15;
|
||||
SELECT coalesce(number % 2 = 0 ? number : NULL, number % 3 = 0 ? number : NULL, 100) AS res, toTypeName(res) FROM system.numbers LIMIT 15;
|
||||
|
Loading…
Reference in New Issue
Block a user