| 1 |
#@on-error omit |
| 2 |
plugin_register sharding |
| 3 |
#@on-error default |
| 4 |
|
| 5 |
plugin_register functions/vector |
| 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": 1000}, |
| 18 |
{"timestamp": "2017/04/15 01:00:00", "price": 900} |
| 19 |
] |
| 20 |
|
| 21 |
load --table Logs_20170416 |
| 22 |
[ |
| 23 |
{"timestamp": "2017/04/16 10:00:00", "price": 520}, |
| 24 |
{"timestamp": "2017/04/16 11:00:00", "price": 510}, |
| 25 |
{"timestamp": "2017/04/16 12:00:00", "price": 500} |
| 26 |
] |
| 27 |
|
| 28 |
table_create Vector TABLE_PAT_KEY UInt32 |
| 29 |
|
| 30 |
logical_select Logs \ |
| 31 |
--shard_key timestamp \ |
| 32 |
--columns[vector].stage initial \ |
| 33 |
--columns[vector].type ShortText \ |
| 34 |
--columns[vector].flags COLUMN_VECTOR \ |
| 35 |
--columns[vector].value "vector_new()" \ |
| 36 |
--output_columns vector |
| 37 |
|
| 38 |
logical_select Logs \ |
| 39 |
--shard_key timestamp \ |
| 40 |
--columns[vector].stage initial \ |
| 41 |
--columns[vector].type ShortText \ |
| 42 |
--columns[vector].flags COLUMN_VECTOR|WITH_WEIGHT \ |
| 43 |
--columns[vector].value "vector_new()" \ |
| 44 |
--output_columns vector |