| 1 |
plugin_register sharding |
| 2 |
[[0,0.0,0.0],true] |
| 3 |
plugin_register functions/number |
| 4 |
[[0,0.0,0.0],true] |
| 5 |
table_create Logs_20170415 TABLE_NO_KEY |
| 6 |
[[0,0.0,0.0],true] |
| 7 |
column_create Logs_20170415 timestamp COLUMN_SCALAR Time |
| 8 |
[[0,0.0,0.0],true] |
| 9 |
column_create Logs_20170415 price COLUMN_SCALAR UInt32 |
| 10 |
[[0,0.0,0.0],true] |
| 11 |
table_create Logs_20170416 TABLE_NO_KEY |
| 12 |
[[0,0.0,0.0],true] |
| 13 |
column_create Logs_20170416 timestamp COLUMN_SCALAR Time |
| 14 |
[[0,0.0,0.0],true] |
| 15 |
column_create Logs_20170416 price COLUMN_SCALAR UInt32 |
| 16 |
[[0,0.0,0.0],true] |
| 17 |
load --table Logs_20170415 |
| 18 |
[ |
| 19 |
{"timestamp": "2017/04/15 00:00:00", "price": 100}, |
| 20 |
{"timestamp": "2017/04/15 01:00:00", "price": 200} |
| 21 |
] |
| 22 |
[[0,0.0,0.0],2] |
| 23 |
load --table Logs_20170416 |
| 24 |
[ |
| 25 |
{"timestamp": "2017/04/16 10:00:00", "price": 300}, |
| 26 |
{"timestamp": "2017/04/16 11:00:00", "price": 400}, |
| 27 |
{"timestamp": "2017/04/16 11:00:00", "price": 500} |
| 28 |
] |
| 29 |
[[0,0.0,0.0],3] |
| 30 |
logical_select Logs --shard_key timestamp --columns[price_with_tax].stage initial --columns[price_with_tax].type UInt32 --columns[price_with_tax].flags COLUMN_SCALAR --columns[price_with_tax].value 'price * 1.05' --output_columns price,price_with_tax |
| 31 |
[ |
| 32 |
[ |
| 33 |
0, |
| 34 |
0.0, |
| 35 |
0.0 |
| 36 |
], |
| 37 |
[ |
| 38 |
[ |
| 39 |
[ |
| 40 |
5 |
| 41 |
], |
| 42 |
[ |
| 43 |
[ |
| 44 |
"price", |
| 45 |
"UInt32" |
| 46 |
], |
| 47 |
[ |
| 48 |
"price_with_tax", |
| 49 |
"UInt32" |
| 50 |
] |
| 51 |
], |
| 52 |
[ |
| 53 |
100, |
| 54 |
105 |
| 55 |
], |
| 56 |
[ |
| 57 |
200, |
| 58 |
210 |
| 59 |
], |
| 60 |
[ |
| 61 |
300, |
| 62 |
315 |
| 63 |
], |
| 64 |
[ |
| 65 |
400, |
| 66 |
420 |
| 67 |
], |
| 68 |
[ |
| 69 |
500, |
| 70 |
525 |
| 71 |
] |
| 72 |
] |
| 73 |
] |
| 74 |
] |
| 75 |
logical_select Logs --shard_key timestamp --columns[price_with_tax].stage initial --columns[price_with_tax].type UInt32 --columns[price_with_tax].flags COLUMN_SCALAR --columns[price_with_tax].value 'price * 1.08' --output_columns price,price_with_tax |
| 76 |
[ |
| 77 |
[ |
| 78 |
0, |
| 79 |
0.0, |
| 80 |
0.0 |
| 81 |
], |
| 82 |
[ |
| 83 |
[ |
| 84 |
[ |
| 85 |
5 |
| 86 |
], |
| 87 |
[ |
| 88 |
[ |
| 89 |
"price", |
| 90 |
"UInt32" |
| 91 |
], |
| 92 |
[ |
| 93 |
"price_with_tax", |
| 94 |
"UInt32" |
| 95 |
] |
| 96 |
], |
| 97 |
[ |
| 98 |
100, |
| 99 |
108 |
| 100 |
], |
| 101 |
[ |
| 102 |
200, |
| 103 |
216 |
| 104 |
], |
| 105 |
[ |
| 106 |
300, |
| 107 |
324 |
| 108 |
], |
| 109 |
[ |
| 110 |
400, |
| 111 |
432 |
| 112 |
], |
| 113 |
[ |
| 114 |
500, |
| 115 |
540 |
| 116 |
] |
| 117 |
] |
| 118 |
] |
| 119 |
] |