mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 17:02:25 +00:00
fix: doc and test
This commit is contained in:
parent
c414a3aebf
commit
1f21131db6
@ -1436,16 +1436,17 @@ dateTimeToSnowflake(value)
|
||||
Query:
|
||||
|
||||
``` sql
|
||||
SELECT dateTimeToSnowflake(CAST('2021-08-15 18:57:56', 'DateTime'));
|
||||
WITH toDateTime('2021-08-15 18:57:56', 'Asia/Shanghai') AS dt
|
||||
SELECT dateTimeToSnowflake(dt);
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
``` text
|
||||
|
||||
┌─dateTimeToSnowflake(CAST('2021-08-15 18:57:56', 'DateTime'))─┐
|
||||
│ 1426860702823350272 │
|
||||
└──────────────────────────────────────────────────────────────┘
|
||||
┌─dateTimeToSnowflake(dt)─┐
|
||||
│ 1426860702823350272 │
|
||||
└─────────────────────────┘
|
||||
```
|
||||
|
||||
|
||||
@ -1473,13 +1474,14 @@ dateTime64ToSnowflake(value)
|
||||
Query:
|
||||
|
||||
``` sql
|
||||
SELECT dateTime64ToSnowflake(CAST('2021-08-15 18:57:56.073', 'DateTime64'));
|
||||
WITH toDateTime64('2021-08-15 18:57:56.492', 3, 'Asia/Shanghai') AS dt64
|
||||
SELECT dateTime64ToSnowflake(dt64);
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
``` text
|
||||
┌─dateTime64ToSnowflake(CAST('2021-08-15 18:57:56.073', 'DateTime64'))─┐
|
||||
│ 1426860703129534464 │
|
||||
└──────────────────────────────────────────────────────────────────────┘
|
||||
┌─dateTime64ToSnowflake(dt64)─┐
|
||||
│ 1426860704886947840 │
|
||||
└─────────────────────────────┘
|
||||
```
|
@ -9,15 +9,15 @@ 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
|
||||
WITH toDateTime('2021-08-15 18:57:56', 'Asia/Shanghai') AS dt
|
||||
SELECT dt, dateTimeToSnowflake(dt);
|
||||
|
||||
WITH toDateTime64('2021-08-15 18:57:56.492', 3) AS dt64
|
||||
WITH toDateTime64('2021-08-15 18:57:56.492', 3, 'Asia/Shanghai') AS dt64
|
||||
SELECT dt64, dateTime64ToSnowflake(dt64);
|
||||
|
||||
SELECT 'non-const column';
|
||||
WITH toDateTime('2021-08-15 18:57:56') AS x
|
||||
WITH toDateTime('2021-08-15 18:57:56', 'Asia/Shanghai') AS x
|
||||
SELECT materialize(x) as dt, dateTimeToSnowflake(dt);;
|
||||
|
||||
WITH toDateTime64('2021-08-15 18:57:56.492', 3) AS x
|
||||
WITH toDateTime64('2021-08-15 18:57:56.492', 3, 'Asia/Shanghai') AS x
|
||||
SELECT materialize(x) as dt64, dateTime64ToSnowflake(dt64);
|
||||
|
Loading…
Reference in New Issue
Block a user