2020-05-06 12:56:03 +00:00
|
|
|
-- Error cases
|
2024-05-30 12:27:25 +00:00
|
|
|
SELECT toStartOfSecond('123'); -- {serverError ILLEGAL_TYPE_OF_ARGUMENT}
|
|
|
|
SELECT toStartOfSecond(now()); -- {serverError ILLEGAL_TYPE_OF_ARGUMENT}
|
|
|
|
SELECT toStartOfSecond(); -- {serverError NUMBER_OF_ARGUMENTS_DOESNT_MATCH}
|
|
|
|
SELECT toStartOfSecond(now64(), 123); -- {serverError ILLEGAL_TYPE_OF_ARGUMENT}
|
2020-05-06 12:56:03 +00:00
|
|
|
|
2022-03-11 23:45:26 +00:00
|
|
|
WITH toDateTime64('2019-09-16 19:20:11', 3, 'Asia/Istanbul') AS dt64 SELECT toStartOfSecond(dt64, 'UTC') AS res, toTypeName(res);
|
2020-05-06 12:56:03 +00:00
|
|
|
WITH toDateTime64('2019-09-16 19:20:11', 0, 'UTC') AS dt64 SELECT toStartOfSecond(dt64) AS res, toTypeName(res);
|
|
|
|
WITH toDateTime64('2019-09-16 19:20:11.123', 3, 'UTC') AS dt64 SELECT toStartOfSecond(dt64) AS res, toTypeName(res);
|
|
|
|
WITH toDateTime64('2019-09-16 19:20:11.123', 9, 'UTC') AS dt64 SELECT toStartOfSecond(dt64) AS res, toTypeName(res);
|
|
|
|
|
|
|
|
SELECT 'non-const column';
|
2020-11-24 09:59:41 +00:00
|
|
|
WITH toDateTime64('2019-09-16 19:20:11.123', 3, 'UTC') AS dt64 SELECT toStartOfSecond(materialize(dt64)) AS res, toTypeName(res);
|