mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 05:32:52 +00:00
24 lines
804 B
MySQL
24 lines
804 B
MySQL
|
-- Error cases
|
||
|
SELECT dateTimeToSnowflake(); -- {serverError 42}
|
||
|
SELECT dateTime64ToSnowflake(); -- {serverError 42}
|
||
|
|
||
|
SELECT dateTimeToSnowflake('abc'); -- {serverError 43}
|
||
|
SELECT dateTime64ToSnowflake('abc'); -- {serverError 43}
|
||
|
|
||
|
SELECT dateTimeToSnowflake('abc', 123); -- {serverError 42}
|
||
|
SELECT dateTime64ToSnowflake('abc', 123); -- {serverError 42}
|
||
|
|
||
|
SELECT 'const column';
|
||
|
WITH toDateTime('2021-08-15 18:57:56') AS dt
|
||
|
SELECT dt, dateTimeToSnowflake(dt);
|
||
|
|
||
|
WITH toDateTime64('2021-08-15 18:57:56.492', 3) AS dt64
|
||
|
SELECT dt64, dateTime64ToSnowflake(dt64);
|
||
|
|
||
|
SELECT 'non-const column';
|
||
|
WITH toDateTime('2021-08-15 18:57:56') AS x
|
||
|
SELECT materialize(x) as dt, dateTimeToSnowflake(dt);;
|
||
|
|
||
|
WITH toDateTime64('2021-08-15 18:57:56.492', 3) AS x
|
||
|
SELECT materialize(x) as dt64, dateTime64ToSnowflake(dt64);
|