Debian Codegraph @

test/command/suite/sharding/logical_select/cache/drilldowns/table.test

raw
1 #@on-error omit
2 plugin_register sharding
3 #@on-error default
4
5 table_create Logs_20150203 TABLE_NO_KEY
6 column_create Logs_20150203 timestamp COLUMN_SCALAR Time
7 column_create Logs_20150203 memo COLUMN_SCALAR ShortText
8 column_create Logs_20150203 action COLUMN_SCALAR ShortText
9
10 table_create Logs_20150204 TABLE_NO_KEY
11 column_create Logs_20150204 timestamp COLUMN_SCALAR Time
12 column_create Logs_20150204 memo COLUMN_SCALAR ShortText
13 column_create Logs_20150204 action COLUMN_SCALAR ShortText
14
15 table_create Logs_20150205 TABLE_NO_KEY
16 column_create Logs_20150205 timestamp COLUMN_SCALAR Time
17 column_create Logs_20150205 memo COLUMN_SCALAR ShortText
18 column_create Logs_20150205 action COLUMN_SCALAR ShortText
19
20 load --table Logs_20150203
21 [
22 {
23 "timestamp": "2015-02-03 12:49:00",
24 "memo": "2015-02-03 12:49:00",
25 "action": "Start"
26 },
27 {
28 "timestamp": "2015-02-03 23:59:59",
29 "memo": "2015-02-03 23:59:59",
30 "action": "Shutdown"
31 }
32 ]
33
34 load --table Logs_20150204
35 [
36 {
37 "timestamp": "2015-02-04 00:00:00",
38 "memo": "2015-02-04 00:00:00",
39 "action": "Start"
40 },
41 {
42 "timestamp": "2015-02-04 13:49:00",
43 "memo": "2015-02-04 13:49:00",
44 "action": "Restart"
45 },
46 {
47 "timestamp": "2015-02-04 13:50:00",
48 "memo": "2015-02-04 13:50:00",
49 "action": "Restart"
50 }
51 ]
52
53 load --table Logs_20150205
54 [
55 {
56 "timestamp": "2015-02-05 13:49:00",
57 "memo": "2015-02-05 13:49:00",
58 "action": "Restart"
59 },
60 {
61 "timestamp": "2015-02-05 13:50:00",
62 "memo": "2015-02-05 13:50:00",
63 "action": "Restart"
64 },
65 {
66 "timestamp": "2015-02-05 13:51:00",
67 "memo": "2015-02-05 13:51:00",
68 "action": "Restart"
69 },
70 {
71 "timestamp": "2015-02-05 13:52:00",
72 "memo": "2015-02-05 13:52:00",
73 "action": "Shutdown"
74 }
75 ]
76
77 #@sleep 1
78
79 #@collect-query-log true
80 logical_select Logs \
81 --shard_key timestamp \
82 --limit 0 \
83 --output_columns _id \
84 --drilldowns[action].table restart \
85 --drilldowns[action].keys _key \
86 --drilldowns[restart].stage initial \
87 --drilldowns[restart].keys 'action' \
88 --drilldowns[restart].filter "_key @ 'Restart'" \
89 --drilldowns[restart].output_columns _key \
90 --drilldowns[start].stage initial \
91 --drilldowns[start].keys 'action' \
92 --drilldowns[start].filter "_key @ 'Start'" \
93 --drilldowns[start].output_columns _key
94
95 logical_select Logs \
96 --shard_key timestamp \
97 --limit 0 \
98 --output_columns _id \
99 --drilldowns[action].table start \
100 --drilldowns[action].keys _key \
101 --drilldowns[restart].stage initial \
102 --drilldowns[restart].keys 'action' \
103 --drilldowns[restart].filter "_key @ 'Restart'" \
104 --drilldowns[restart].output_columns _key \
105 --drilldowns[start].stage initial \
106 --drilldowns[start].keys 'action' \
107 --drilldowns[start].filter "_key @ 'Start'" \
108 --drilldowns[start].output_columns _key
109 #@collect-query-log false