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