Debian Codegraph @

test/command/suite/sharding/logical_select/cache/columns/value.test

raw
1 #@on-error omit
2 plugin_register sharding
3 #@on-error default
4
5 plugin_register functions/number
6
7 table_create Logs_20170415 TABLE_NO_KEY
8 column_create Logs_20170415 timestamp COLUMN_SCALAR Time
9 column_create Logs_20170415 price COLUMN_SCALAR UInt32
10
11 table_create Logs_20170416 TABLE_NO_KEY
12 column_create Logs_20170416 timestamp COLUMN_SCALAR Time
13 column_create Logs_20170416 price COLUMN_SCALAR UInt32
14
15 load --table Logs_20170415
16 [
17 {"timestamp": "2017/04/15 00:00:00", "price": 100},
18 {"timestamp": "2017/04/15 01:00:00", "price": 200}
19 ]
20
21 load --table Logs_20170416
22 [
23 {"timestamp": "2017/04/16 10:00:00", "price": 300},
24 {"timestamp": "2017/04/16 11:00:00", "price": 400},
25 {"timestamp": "2017/04/16 11:00:00", "price": 500}
26 ]
27
28 logical_select Logs \
29 --shard_key timestamp \
30 --columns[price_with_tax].stage initial \
31 --columns[price_with_tax].type UInt32 \
32 --columns[price_with_tax].flags COLUMN_SCALAR \
33 --columns[price_with_tax].value 'price * 1.05' \
34 --output_columns price,price_with_tax
35
36 logical_select Logs \
37 --shard_key timestamp \
38 --columns[price_with_tax].stage initial \
39 --columns[price_with_tax].type UInt32 \
40 --columns[price_with_tax].flags COLUMN_SCALAR \
41 --columns[price_with_tax].value 'price * 1.08' \
42 --output_columns price,price_with_tax