mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
try fix test to avoid timezone dependency
Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
This commit is contained in:
parent
5cb55ca1b6
commit
046ab54d0b
@ -1,2 +1 @@
|
||||
1 2023-05-04 22:17:23 0
|
||||
2 2023-05-04 22:17:23 0
|
||||
2
|
||||
|
@ -2,8 +2,9 @@ DROP TABLE IF EXISTS t;
|
||||
|
||||
CREATE TABLE t (id UInt64, ts DateTime) ENGINE = MergeTree() ORDER BY (id, ts) SETTINGS index_granularity = 2;
|
||||
|
||||
INSERT INTO t VALUES (1, '2023-05-04 21:17:23') (1, '2023-05-04 22:17:23') (2, '2023-05-04 22:17:23') (2, '2023-05-04 23:17:23');
|
||||
INSERT INTO t VALUES
|
||||
(1, toDateTime('2023-05-04 21:17:23', 'UTC')), (1, toDateTime('2023-05-04 22:17:23', 'UTC')), (2, toDateTime('2023-05-04 22:17:23', 'UTC')), (2, toDateTime('2023-05-04 23:17:23', 'UTC'));
|
||||
|
||||
SELECT *, abs(toUnixTimestamp(ts) - toUnixTimestamp(1683238643)) AS error FROM t WHERE error < 3600;
|
||||
SELECT count(abs(toUnixTimestamp(ts, 'UTC') - toUnixTimestamp('2023-05-04 22:17:23', 'UTC')) AS error) FROM t WHERE error < 3600;
|
||||
|
||||
DROP TABLE IF EXISTS t;
|
||||
|
Loading…
Reference in New Issue
Block a user