mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 10:02:01 +00:00
update tests
This commit is contained in:
parent
98740eec2e
commit
14ba0ef1bf
@ -9,8 +9,8 @@ CREATE TABLE dst(count UInt64) Engine=MergeTree ORDER BY tuple();
|
|||||||
CREATE TABLE mt(a Int32, timestamp DateTime) ENGINE=MergeTree ORDER BY tuple();
|
CREATE TABLE mt(a Int32, timestamp DateTime) ENGINE=MergeTree ORDER BY tuple();
|
||||||
CREATE WINDOW VIEW wv TO dst AS SELECT count(a) AS count FROM mt GROUP BY TUMBLE(timestamp, INTERVAL '1' SECOND, 'US/Samoa') AS wid;
|
CREATE WINDOW VIEW wv TO dst AS SELECT count(a) AS count FROM mt GROUP BY TUMBLE(timestamp, INTERVAL '1' SECOND, 'US/Samoa') AS wid;
|
||||||
|
|
||||||
INSERT INTO mt VALUES (1, now());
|
INSERT INTO mt VALUES (1, now() + 1);
|
||||||
SELECT sleep(2);
|
SELECT sleep(3);
|
||||||
SELECT count from dst;
|
SELECT count from dst;
|
||||||
|
|
||||||
DROP TABLE wv;
|
DROP TABLE wv;
|
||||||
|
@ -9,8 +9,8 @@ CREATE TABLE dst(count UInt64) Engine=MergeTree ORDER BY tuple();
|
|||||||
CREATE TABLE mt(a Int32, timestamp DateTime) ENGINE=MergeTree ORDER BY tuple();
|
CREATE TABLE mt(a Int32, timestamp DateTime) ENGINE=MergeTree ORDER BY tuple();
|
||||||
CREATE WINDOW VIEW wv TO dst AS SELECT count(a) AS count FROM mt GROUP BY HOP(timestamp, INTERVAL '1' SECOND, INTERVAL '1' SECOND, 'US/Samoa') AS wid;
|
CREATE WINDOW VIEW wv TO dst AS SELECT count(a) AS count FROM mt GROUP BY HOP(timestamp, INTERVAL '1' SECOND, INTERVAL '1' SECOND, 'US/Samoa') AS wid;
|
||||||
|
|
||||||
INSERT INTO mt VALUES (1, now());
|
INSERT INTO mt VALUES (1, now() + 1);
|
||||||
SELECT sleep(2);
|
SELECT sleep(3);
|
||||||
SELECT count from dst;
|
SELECT count from dst;
|
||||||
|
|
||||||
DROP TABLE wv;
|
DROP TABLE wv;
|
||||||
|
@ -38,7 +38,8 @@ with client(name='client1>', log=log) as client1, client(name='client2>', log=lo
|
|||||||
client1.expect(prompt)
|
client1.expect(prompt)
|
||||||
|
|
||||||
client1.send('WATCH 01056_window_view_proc_hop_watch.wv')
|
client1.send('WATCH 01056_window_view_proc_hop_watch.wv')
|
||||||
client2.send("INSERT INTO 01056_window_view_proc_hop_watch.mt VALUES (1, now('US/Samoa'))")
|
client1.expect('Query id' + end_of_block)
|
||||||
|
client2.send("INSERT INTO 01056_window_view_proc_hop_watch.mt VALUES (1, now() + 1)")
|
||||||
client1.expect('1' + end_of_block)
|
client1.expect('1' + end_of_block)
|
||||||
client1.expect('Progress: 1.00 rows.*\)')
|
client1.expect('Progress: 1.00 rows.*\)')
|
||||||
|
|
||||||
@ -52,3 +53,5 @@ with client(name='client1>', log=log) as client1, client(name='client2>', log=lo
|
|||||||
client1.expect(prompt)
|
client1.expect(prompt)
|
||||||
client1.send('DROP TABLE 01056_window_view_proc_hop_watch.mt')
|
client1.send('DROP TABLE 01056_window_view_proc_hop_watch.mt')
|
||||||
client1.expect(prompt)
|
client1.expect(prompt)
|
||||||
|
client1.send('DROP DATABASE IF EXISTS 01056_window_view_proc_hop_watch')
|
||||||
|
client1.expect(prompt)
|
||||||
|
@ -34,7 +34,7 @@ with client(name='client1>', log=log) as client1, client(name='client2>', log=lo
|
|||||||
client1.expect(prompt)
|
client1.expect(prompt)
|
||||||
|
|
||||||
client1.send('WATCH db_01059_event_hop_watch_strict_asc.wv')
|
client1.send('WATCH db_01059_event_hop_watch_strict_asc.wv')
|
||||||
|
client1.expect('Query id' + end_of_block)
|
||||||
client2.send("INSERT INTO db_01059_event_hop_watch_strict_asc.mt VALUES (1, toDateTime('1990/01/01 12:00:00', 'US/Samoa'));")
|
client2.send("INSERT INTO db_01059_event_hop_watch_strict_asc.mt VALUES (1, toDateTime('1990/01/01 12:00:00', 'US/Samoa'));")
|
||||||
client2.expect("Ok.")
|
client2.expect("Ok.")
|
||||||
client2.send("INSERT INTO db_01059_event_hop_watch_strict_asc.mt VALUES (1, toDateTime('1990/01/01 12:00:05', 'US/Samoa'));")
|
client2.send("INSERT INTO db_01059_event_hop_watch_strict_asc.mt VALUES (1, toDateTime('1990/01/01 12:00:05', 'US/Samoa'));")
|
||||||
@ -54,3 +54,9 @@ with client(name='client1>', log=log) as client1, client(name='client2>', log=lo
|
|||||||
if match.groups()[1]:
|
if match.groups()[1]:
|
||||||
client1.send(client1.command)
|
client1.send(client1.command)
|
||||||
client1.expect(prompt)
|
client1.expect(prompt)
|
||||||
|
client1.send('DROP TABLE db_01059_event_hop_watch_strict_asc.wv NO DELAY')
|
||||||
|
client1.expect(prompt)
|
||||||
|
client1.send('DROP TABLE db_01059_event_hop_watch_strict_asc.mt')
|
||||||
|
client1.expect(prompt)
|
||||||
|
client1.send('DROP DATABASE IF EXISTS db_01059_event_hop_watch_strict_asc')
|
||||||
|
client1.expect(prompt)
|
||||||
|
@ -36,6 +36,7 @@ with client(name='client1>', log=log) as client1, client(name='client2>', log=lo
|
|||||||
client1.expect(prompt)
|
client1.expect(prompt)
|
||||||
|
|
||||||
client1.send('WATCH 01062_window_view_event_hop_watch_asc.wv')
|
client1.send('WATCH 01062_window_view_event_hop_watch_asc.wv')
|
||||||
|
client1.expect('Query id' + end_of_block)
|
||||||
client2.send("INSERT INTO 01062_window_view_event_hop_watch_asc.mt VALUES (1, '1990/01/01 12:00:00');")
|
client2.send("INSERT INTO 01062_window_view_event_hop_watch_asc.mt VALUES (1, '1990/01/01 12:00:00');")
|
||||||
client2.expect(prompt)
|
client2.expect(prompt)
|
||||||
client2.send("INSERT INTO 01062_window_view_event_hop_watch_asc.mt VALUES (1, '1990/01/01 12:00:05');")
|
client2.send("INSERT INTO 01062_window_view_event_hop_watch_asc.mt VALUES (1, '1990/01/01 12:00:05');")
|
||||||
@ -43,12 +44,11 @@ with client(name='client1>', log=log) as client1, client(name='client2>', log=lo
|
|||||||
client1.expect('1*' + end_of_block)
|
client1.expect('1*' + end_of_block)
|
||||||
client2.send("INSERT INTO 01062_window_view_event_hop_watch_asc.mt VALUES (1, '1990/01/01 12:00:06');")
|
client2.send("INSERT INTO 01062_window_view_event_hop_watch_asc.mt VALUES (1, '1990/01/01 12:00:06');")
|
||||||
client2.expect(prompt)
|
client2.expect(prompt)
|
||||||
client1.expect(r'Progress')
|
|
||||||
client2.send("INSERT INTO 01062_window_view_event_hop_watch_asc.mt VALUES (1, '1990/01/01 12:00:10');")
|
client2.send("INSERT INTO 01062_window_view_event_hop_watch_asc.mt VALUES (1, '1990/01/01 12:00:10');")
|
||||||
client2.expect(prompt)
|
client2.expect(prompt)
|
||||||
client1.expect(r'1*' + end_of_block)
|
client1.expect('1' + end_of_block)
|
||||||
client1.expect(r'2*' + end_of_block)
|
client1.expect('2' + end_of_block)
|
||||||
client1.expect(r'Progress')
|
client1.expect('Progress: 3.00 rows.*\)')
|
||||||
|
|
||||||
# send Ctrl-C
|
# send Ctrl-C
|
||||||
client1.send('\x03', eol='')
|
client1.send('\x03', eol='')
|
||||||
@ -60,3 +60,5 @@ with client(name='client1>', log=log) as client1, client(name='client2>', log=lo
|
|||||||
client1.expect(prompt)
|
client1.expect(prompt)
|
||||||
client1.send('DROP TABLE 01062_window_view_event_hop_watch_asc.mt')
|
client1.send('DROP TABLE 01062_window_view_event_hop_watch_asc.mt')
|
||||||
client1.expect(prompt)
|
client1.expect(prompt)
|
||||||
|
client1.send('DROP DATABASE IF EXISTS 01062_window_view_event_hop_watch_asc')
|
||||||
|
client1.expect(prompt)
|
||||||
|
@ -36,10 +36,13 @@ with client(name='client1>', log=log) as client1, client(name='client2>', log=lo
|
|||||||
client1.expect(prompt)
|
client1.expect(prompt)
|
||||||
|
|
||||||
client1.send('WATCH 01069_window_view_proc_tumble_watch.wv')
|
client1.send('WATCH 01069_window_view_proc_tumble_watch.wv')
|
||||||
client2.send("INSERT INTO 01069_window_view_proc_tumble_watch.mt VALUES (1, now('US/Samoa'))")
|
client1.expect('Query id' + end_of_block)
|
||||||
|
client2.send("INSERT INTO 01069_window_view_proc_tumble_watch.mt VALUES (1, now('US/Samoa') + 1)")
|
||||||
|
client2.expect("Ok.")
|
||||||
client1.expect('1' + end_of_block)
|
client1.expect('1' + end_of_block)
|
||||||
client1.expect('Progress: 1.00 rows.*\)')
|
client1.expect('Progress: 1.00 rows.*\)')
|
||||||
client2.send("INSERT INTO 01069_window_view_proc_tumble_watch.mt VALUES (1, now('US/Samoa'))")
|
client2.send("INSERT INTO 01069_window_view_proc_tumble_watch.mt VALUES (1, now('US/Samoa') + 1)")
|
||||||
|
client2.expect("Ok.")
|
||||||
client1.expect('1' + end_of_block)
|
client1.expect('1' + end_of_block)
|
||||||
client1.expect('Progress: 2.00 rows.*\)')
|
client1.expect('Progress: 2.00 rows.*\)')
|
||||||
|
|
||||||
@ -53,3 +56,5 @@ with client(name='client1>', log=log) as client1, client(name='client2>', log=lo
|
|||||||
client1.expect(prompt)
|
client1.expect(prompt)
|
||||||
client1.send('DROP TABLE 01069_window_view_proc_tumble_watch.mt')
|
client1.send('DROP TABLE 01069_window_view_proc_tumble_watch.mt')
|
||||||
client1.expect(prompt)
|
client1.expect(prompt)
|
||||||
|
client1.send('DROP DATABASE IF EXISTS 01069_window_view_proc_tumble_watch')
|
||||||
|
client1.expect(prompt)
|
||||||
|
Loading…
Reference in New Issue
Block a user