fix the timestamps for the tests

This commit is contained in:
Martijn Bakker 2019-03-26 21:26:14 +00:00
parent 84f40ddf02
commit 8d6f554f1a
4 changed files with 28 additions and 28 deletions

View File

@ -1,14 +1,14 @@
1 1970-01-01 01:00:05 1 1.5 2
1 1970-01-01 01:00:06 1 1.51 2
1 1970-01-01 01:00:10 11 11.5 12
1 1970-01-01 01:00:11 11 11.51 12
1 1970-01-01 01:00:15 5 5.5 6
1 1970-01-01 01:00:16 5 5.6 6
1 1970-01-01 01:00:20 7 7.5 8
2 1970-01-01 01:00:05 11 2.5 12
2 1970-01-01 01:00:06 11 2.51 12
2 1970-01-01 01:00:10 21 12.5 22
2 1970-01-01 01:00:11 21 12.51 22
2 1970-01-01 01:00:15 5 6.5 6
2 1970-01-01 01:00:16 5 5.6 6
2 1970-01-01 01:00:20 17 8.5 18
1 1970-01-01 00:00:05 1 1.5 2
1 1970-01-01 00:00:06 1 1.51 2
1 1970-01-01 00:00:10 11 11.5 12
1 1970-01-01 00:00:11 11 11.51 12
1 1970-01-01 00:00:15 5 5.5 6
1 1970-01-01 00:00:16 5 5.6 6
1 1970-01-01 00:00:20 7 7.5 8
2 1970-01-01 00:00:05 11 2.5 12
2 1970-01-01 00:00:06 11 2.51 12
2 1970-01-01 00:00:10 21 12.5 22
2 1970-01-01 00:00:11 21 12.51 22
2 1970-01-01 00:00:15 5 6.5 6
2 1970-01-01 00:00:16 5 5.6 6
2 1970-01-01 00:00:20 17 8.5 18

View File

@ -11,7 +11,7 @@ CREATE TABLE tv(key UInt32, t DateTime, tv Float64) ENGINE = MergeTree() ORDER B
INSERT INTO test.tv(key,t,tv) VALUES (1,5,1.5),(1,6,1.51),(1,10,11.5),(1,11,11.51),(1,15,5.5),(1,16,5.6),(1,20,7.5);
INSERT INTO test.tv(key,t,tv) VALUES (2,5,2.5),(2,6,2.51),(2,10,12.5),(2,11,12.51),(2,15,6.5),(2,16,5.6),(2,20,8.5);
SELECT tv.key, tv.t, md.bid, tv.tv, md.ask FROM tv ASOF LEFT JOIN md USING(key,t) ORDER BY (tv.key, tv.t);
SELECT tv.key, toString(tv.t, 'UTC'), md.bid, tv.tv, md.ask FROM tv ASOF LEFT JOIN md USING(key,t) ORDER BY (tv.key, tv.t);
DROP TABLE md;
DROP TABLE tv;
DROP TABLE tv;

View File

@ -1,10 +1,10 @@
1 1970-01-01 01:00:01 1 0 0000-00-00 00:00:00 0
1 1970-01-01 01:00:02 2 2 1970-01-01 01:00:02 1
1 1970-01-01 01:00:03 3 2 1970-01-01 01:00:03 1
1 1970-01-01 01:00:04 4 4 1970-01-01 01:00:04 1
1 1970-01-01 01:00:05 5 4 1970-01-01 01:00:05 1
2 1970-01-01 01:00:01 1 0 0000-00-00 00:00:00 0
2 1970-01-01 01:00:02 2 0 0000-00-00 00:00:00 0
2 1970-01-01 01:00:03 3 3 1970-01-01 01:00:03 2
2 1970-01-01 01:00:04 4 3 1970-01-01 01:00:04 2
2 1970-01-01 01:00:05 5 3 1970-01-01 01:00:05 2
1 1970-01-01 00:00:01 1 0 0000-00-00 00:00:00 0
1 1970-01-01 00:00:02 2 2 1970-01-01 00:00:02 1
1 1970-01-01 00:00:03 3 2 1970-01-01 00:00:03 1
1 1970-01-01 00:00:04 4 4 1970-01-01 00:00:04 1
1 1970-01-01 00:00:05 5 4 1970-01-01 00:00:05 1
2 1970-01-01 00:00:01 1 0 0000-00-00 00:00:00 0
2 1970-01-01 00:00:02 2 0 0000-00-00 00:00:00 0
2 1970-01-01 00:00:03 3 3 1970-01-01 00:00:03 2
2 1970-01-01 00:00:04 4 3 1970-01-01 00:00:04 2
2 1970-01-01 00:00:05 5 3 1970-01-01 00:00:05 2

View File

@ -11,8 +11,8 @@ CREATE TABLE B(k UInt32, t DateTime, b Float64) ENGINE = MergeTree() ORDER BY (k
INSERT INTO B(k,t,b) VALUES (1,2,2),(1,4,4);
INSERT INTO B(k,t,b) VALUES (2,3,3);
SELECT A.k, A.t, A.a, B.b, B.t, B.k FROM A ASOF LEFT JOIN B USING(k,t) ORDER BY (A.k, A.t);
SELECT A.k, toString(A.t, 'UTC'), A.a, B.b, toString(B.t, 'UTC'), B.k FROM A ASOF LEFT JOIN B USING(k,t) ORDER BY (A.k, A.t);
DROP TABLE A;
DROP TABLE B;
DROP TABLE B;