Debian Codegraph @

test/command/suite/select/load_table/key.test

raw
1 table_create Logs TABLE_HASH_KEY ShortText
2 column_create Logs timestamp COLUMN_SCALAR Time
3
4 table_create LoadedLogs TABLE_HASH_KEY ShortText
5 column_create LoadedLogs original_id COLUMN_SCALAR UInt32
6 column_create LoadedLogs timestamp_text COLUMN_SCALAR ShortText
7
8 load --table Logs
9 [
10 {
11 "_key": "2015-02-03:1",
12 "timestamp": "2015-02-03 10:49:00"
13 },
14 {
15 "_key": "2015-02-03:2",
16 "timestamp": "2015-02-03 12:49:00"
17 },
18 {
19 "_key": "2015-02-04:1",
20 "timestamp": "2015-02-04 00:00:00"
21 }
22 ]
23
24 #@collect-query-log true
25 select \
26 Logs \
27 --load_table LoadedLogs \
28 --load_columns "_key, original_id, timestamp_text" \
29 --load_values "cast_loose(ShortText, timestamp, '') + ':' + _id, _id, timestamp" \
30 --limit 0
31 #@collect-query-log false
32
33 select --table LoadedLogs