Debian Codegraph @

test/command/suite/select/cache/columns.test

raw
1 table_create Items TABLE_HASH_KEY ShortText
2 column_create Items price COLUMN_SCALAR UInt32
3
4 load --table Items
5 [
6 {"_key": "Book", "price": 1000},
7 {"_key": "Note", "price": 1000},
8 {"_key": "Box", "price": 520},
9 {"_key": "Pen", "price": 510},
10 {"_key": "Food", "price": 500},
11 {"_key": "Drink", "price": 300}
12 ]
13
14 # To use cache
15 #@sleep 1
16
17 #@collect-query-log true
18 select Items \
19 --columns[price_with_tax].stage initial \
20 --columns[price_with_tax].type UInt32 \
21 --columns[price_with_tax].flags COLUMN_SCALAR \
22 --columns[price_with_tax].value 'price * 1.08'
23
24 #@sleep 1
25
26 select Items \
27 --columns[price_with_tax].stage initial \
28 --columns[price_with_tax].type UInt32 \
29 --columns[price_with_tax].flags COLUMN_SCALAR \
30 --columns[price_with_tax].value 'price * 1.08'
31
32 # There are more spaces around '*' in --columns[price_with_tax].value
33 select Items \
34 --columns[price_with_tax].stage initial \
35 --columns[price_with_tax].type UInt32 \
36 --columns[price_with_tax].flags COLUMN_SCALAR \
37 --columns[price_with_tax].value 'price * 1.08'
38
39 #@collect-query-log false